; generated by Component: ARM Compiler 5.05 update 2 (build 169) Tool: ArmCC [4d0f38]
; commandline ArmCC [--c99 --list --split_sections --debug -c --asm --interleave -o..\..\..\..\build\demo\mico-fire_f429\obj_rvmdk\httpd_handle.o --asm_dir=..\..\..\..\Build\demo\MICO-Fire_F429\list_RVMDK\ --list_dir=..\..\..\..\Build\demo\MICO-Fire_F429\list_RVMDK\ --depend=..\..\..\..\build\demo\mico-fire_f429\obj_rvmdk\httpd_handle.d --cpu=Cortex-M4.fp --apcs=interwork -O0 --diag_suppress=9931,1,1293 -I..\..\..\..\Board\fire_F429 -I..\..\..\..\Demos\fire\ov2640 -I..\..\..\..\include -I..\..\..\..\libraries\utilities -I..\..\..\..\libraries\utilities\json_c -I..\..\..\..\MICO\core -I..\..\..\..\MICO\security -I..\..\..\..\MICO\system -I..\..\..\..\MICO\system\command_console -I..\..\..\..\Platform\include -I..\..\..\..\Platform\Cortex-M4 -I..\..\..\..\Platform\Cortex-M4\CMSIS -I..\..\..\..\Platform\MCU\STM32F4xx\peripherals -I..\..\..\..\Platform\MCU\STM32F4xx\peripherals\Libraries\STM32F4xx_StdPeriph_Driver\inc -I..\..\..\..\Platform\MCU\STM32F4xx\peripherals\Libraries -I..\..\..\..\Platform\MCU\STM32F4xx\wlan_bus_driver -I..\..\..\..\Platform\Drivers\spi_flash -I..\..\..\..\Platform\Drivers -I..\..\..\..\libraries\daemons\homekit_server -I..\..\..\..\libraries\daemons\http_server -I..\..\..\..\Platform\Drivers\malloc -I..\..\..\..\Platform\Drivers\SDRAM -I..\..\..\..\Platform\Drivers\ov5640 -IG:\GIT_OSC\STM32_develop\F429-V2\develop\6-WIFI\STM32-WiFi\3.wifi_ov5640\Projects\STM32F429\demo\RVMDK\RTE -IC:\Keil_v5\ARM\PACK\Keil\STM32F4xx_DFP\2.5.0\Drivers\CMSIS\Device\ST\STM32F4xx\Include -IC:\Keil_v5\ARM\CMSIS\Include -IC:\Keil_v5\ARM\PACK\Keil\STM32F4xx_DFP\2.5.0 -D__UVISION_VERSION=515 -DSTM32F429xx -DUSE_STDPERIPH_DRIVER -DDEBUG -DHSE_VALUE=25000000 -DOV5640 --omf_browse=..\..\..\..\build\demo\mico-fire_f429\obj_rvmdk\httpd_handle.crf ..\..\..\..\libraries\daemons\http_server\httpd_handle.c]
                          THUMB

                          AREA ||i.httpd_handle_message||, CODE, READONLY, ALIGN=2

                  httpd_handle_message PROC
;;;321     */
;;;322    int httpd_handle_message(int conn)
000000  b570              PUSH     {r4-r6,lr}
;;;323    {
000002  b0a0              SUB      sp,sp,#0x80
000004  4605              MOV      r5,r0
;;;324    	int err;
;;;325    	int req_line_len;
;;;326    	char msg_in[128];
;;;327    
;;;328    	/* clear out the httpd_req structure */
;;;329    	memset(&httpd_req, 0x00, sizeof(httpd_req));
000006  f44f71b2          MOV      r1,#0x164
00000a  4823              LDR      r0,|L1.152|
00000c  f7fffffe          BL       __aeabi_memclr4
;;;330    
;;;331    	httpd_req.sock = conn;
000010  4821              LDR      r0,|L1.152|
000012  6485              STR      r5,[r0,#0x48]  ; httpd_req
;;;332    
;;;333    	/* Read the first line of the HTTP header */
;;;334    	req_line_len = htsys_getln_soc(conn, msg_in, sizeof(msg_in));
000014  2280              MOVS     r2,#0x80
000016  4669              MOV      r1,sp
000018  4628              MOV      r0,r5
00001a  f7fffffe          BL       htsys_getln_soc
00001e  4606              MOV      r6,r0
;;;335    	if (req_line_len == 0)
000020  b916              CBNZ     r6,|L1.40|
;;;336    		return HTTPD_DONE;
000022  2001              MOVS     r0,#1
                  |L1.36|
;;;337    
;;;338    	if (req_line_len < 0) {
;;;339    		httpd_d("Could not read from socket");
;;;340    		return -kInProgressErr;
;;;341    	}
;;;342    
;;;343    	/* Parse the first line of the header */
;;;344    	err = httpd_parse_hdr_main(msg_in, &httpd_req);
;;;345    	if (err == -WM_E_HTTPD_NOTSUPP)
;;;346    		/* Send 505 HTTP Version not supported */
;;;347    		return httpd_send_error(conn, HTTP_505);
;;;348    	else if (err != kNoErr) {
;;;349    		/* Send 500 Internal Server Error */
;;;350    		return httpd_send_error(conn, HTTP_500);
;;;351    	}
;;;352    
;;;353    	/* set a generic error that can be overridden by the wsgi handling. */
;;;354    	httpd_d("Presetting");
;;;355    
;;;356    	/* Web Services Gateway Interface branch point:
;;;357    	 * At this point we have the request type (httpd_req.type) and the path
;;;358    	 * (httpd_req.filename) and all the headers waiting to be read from
;;;359    	 * the socket.
;;;360    	 *
;;;361    	 * The call bellow will iterate through all the url patterns and
;;;362    	 * invoke the handlers that match the request type and pattern.  If
;;;363    	 * request type and url patern match, invoke the handler.
;;;364    	 */
;;;365    	err = httpd_wsgi(&httpd_req);
;;;366    
;;;367    	if (err == HTTPD_DONE) {
;;;368    		httpd_d("Done processing request.");
;;;369    		return kNoErr;
;;;370    	} else if (err == -WM_E_HTTPD_NO_HANDLER) {
;;;371    		httpd_d("No handler for the given URL %s was found",
;;;372    			httpd_req.filename);
;;;373    		/*
;;;374    		 * We have not yet read the complete data from the current
;;;375    		 * request, from the socket. We are in an error state and
;;;376    		 * we wish to cancel this HTTP transaction. We sent
;;;377    		 * appropriate message to the client and read (flush) out
;;;378    		 * all the pending data in the socket. We let the client
;;;379    		 * close the socket for us, if necessary.
;;;380    		 */
;;;381    		httpd_purge_socket_data(&httpd_req, msg_in,
;;;382    				sizeof(msg_in), conn);
;;;383    		httpd_set_error("File %s not_found", httpd_req.filename);
;;;384    		httpd_send_error(conn, HTTP_404);
;;;385    		return kNoErr;
;;;386    	} else {
;;;387    		httpd_d("WSGI handler failed.");
;;;388    		/* Send 500 Internal Server Error */
;;;389    		return httpd_send_error(conn, HTTP_500);
;;;390    	}
;;;391    
;;;392    }
000024  b020              ADD      sp,sp,#0x80
000026  bd70              POP      {r4-r6,pc}
                  |L1.40|
000028  2e00              CMP      r6,#0                 ;338
00002a  da02              BGE      |L1.50|
00002c  f04f30ff          MOV      r0,#0xffffffff        ;340
000030  e7f8              B        |L1.36|
                  |L1.50|
000032  4919              LDR      r1,|L1.152|
000034  4668              MOV      r0,sp                 ;344
000036  f7fffffe          BL       httpd_parse_hdr_main
00003a  4604              MOV      r4,r0                 ;344
00003c  1ca0              ADDS     r0,r4,#2              ;345
00003e  b920              CBNZ     r0,|L1.74|
000040  2102              MOVS     r1,#2                 ;347
000042  4628              MOV      r0,r5                 ;347
000044  f7fffffe          BL       httpd_send_error
000048  e7ec              B        |L1.36|
                  |L1.74|
00004a  b124              CBZ      r4,|L1.86|
00004c  2101              MOVS     r1,#1                 ;350
00004e  4628              MOV      r0,r5                 ;350
000050  f7fffffe          BL       httpd_send_error
000054  e7e6              B        |L1.36|
                  |L1.86|
000056  4810              LDR      r0,|L1.152|
000058  f7fffffe          BL       httpd_wsgi
00005c  4604              MOV      r4,r0                 ;365
00005e  2c01              CMP      r4,#1                 ;367
000060  d101              BNE      |L1.102|
000062  2000              MOVS     r0,#0                 ;369
000064  e7de              B        |L1.36|
                  |L1.102|
000066  f1040009          ADD      r0,r4,#9              ;370
00006a  b980              CBNZ     r0,|L1.142|
00006c  462b              MOV      r3,r5                 ;381
00006e  2280              MOVS     r2,#0x80              ;381
000070  4669              MOV      r1,sp                 ;381
000072  4809              LDR      r0,|L1.152|
000074  f7fffffe          BL       httpd_purge_socket_data
000078  4907              LDR      r1,|L1.152|
00007a  1d09              ADDS     r1,r1,#4              ;383
00007c  a007              ADR      r0,|L1.156|
00007e  f7fffffe          BL       httpd_set_error
000082  2100              MOVS     r1,#0                 ;384
000084  4628              MOV      r0,r5                 ;384
000086  f7fffffe          BL       httpd_send_error
00008a  2000              MOVS     r0,#0                 ;385
00008c  e7ca              B        |L1.36|
                  |L1.142|
00008e  2101              MOVS     r1,#1                 ;389
000090  4628              MOV      r0,r5                 ;389
000092  f7fffffe          BL       httpd_send_error
000096  e7c5              B        |L1.36|
                          ENDP

                  |L1.152|
                          DCD      httpd_req
                  |L1.156|
00009c  46696c65          DCB      "File %s not_found",0
0000a0  20257320
0000a4  6e6f745f
0000a8  666f756e
0000ac  6400    
0000ae  00                DCB      0
0000af  00                DCB      0

                          AREA ||i.httpd_purge_socket_data||, CODE, READONLY, ALIGN=1

                  httpd_purge_socket_data PROC
;;;293     */
;;;294    void httpd_purge_socket_data(httpd_request_t *req, char *msg_in,
000000  e92d5ff0          PUSH     {r4-r12,lr}
;;;295    			     int msg_in_len, int conn)
;;;296    {
000004  4680              MOV      r8,r0
000006  4689              MOV      r9,r1
000008  4616              MOV      r6,r2
00000a  461f              MOV      r7,r3
;;;297    	int status = httpd_parse_hdr_tags(req, conn, msg_in, msg_in_len);
00000c  4633              MOV      r3,r6
00000e  464a              MOV      r2,r9
000010  4639              MOV      r1,r7
000012  4640              MOV      r0,r8
000014  f7fffffe          BL       httpd_parse_hdr_tags
000018  4682              MOV      r10,r0
;;;298    	if (status != kNoErr) {
00001a  f1ba0f00          CMP      r10,#0
00001e  d001              BEQ      |L2.36|
                  |L2.32|
;;;299    		/* We were unsuccessful in purging the socket.*/
;;;300    		httpd_d("Unable to purge socket: %d", status);
;;;301    		return;
;;;302    	}
;;;303    
;;;304    	unsigned data_remaining = req->body_nbytes;
;;;305    
;;;306    	while (data_remaining) {
;;;307    		unsigned to_read = msg_in_len >= data_remaining ?
;;;308    			data_remaining : msg_in_len;
;;;309    		int actually_read = httpd_recv(conn, msg_in, to_read, 0);
;;;310    		if (actually_read < 0) {
;;;311    			httpd_d("Unable to read content."
;;;312    				"Was purging socket data");
;;;313    			return;
;;;314    		}
;;;315    		data_remaining -= actually_read;
;;;316    	}
;;;317    }
000020  e8bd9ff0          POP      {r4-r12,pc}
                  |L2.36|
000024  f8d84054          LDR      r4,[r8,#0x54]         ;304
000028  e011              B        |L2.78|
                  |L2.42|
00002a  42a6              CMP      r6,r4                 ;307
00002c  d301              BCC      |L2.50|
00002e  4620              MOV      r0,r4                 ;308
000030  e000              B        |L2.52|
                  |L2.50|
000032  4630              MOV      r0,r6                 ;308
                  |L2.52|
000034  4683              MOV      r11,r0                ;308
000036  2300              MOVS     r3,#0                 ;309
000038  465a              MOV      r2,r11                ;309
00003a  4649              MOV      r1,r9                 ;309
00003c  4638              MOV      r0,r7                 ;309
00003e  f7fffffe          BL       httpd_recv
000042  4605              MOV      r5,r0                 ;309
000044  2d00              CMP      r5,#0                 ;310
000046  da00              BGE      |L2.74|
000048  e7ea              B        |L2.32|
                  |L2.74|
00004a  1b64              SUBS     r4,r4,r5              ;315
00004c  bf00              NOP                            ;316
                  |L2.78|
00004e  2c00              CMP      r4,#0                 ;306
000050  d1eb              BNE      |L2.42|
000052  bf00              NOP      
000054  e7e4              B        |L2.32|
;;;318    
                          ENDP


                          AREA ||i.httpd_recv||, CODE, READONLY, ALIGN=1

                  httpd_recv PROC
;;;155    
;;;156    int httpd_recv(int fd, void *buf, size_t n, int flags)
000000  e92d41f0          PUSH     {r4-r8,lr}
;;;157    {
000004  4604              MOV      r4,r0
000006  460d              MOV      r5,r1
000008  4616              MOV      r6,r2
00000a  461f              MOV      r7,r3
;;;158    #ifdef CONFIG_ENABLE_HTTPS
;;;159    	if (httpd_is_https_active())
;;;160    		return tls_recv(httpd_tls_handle, buf, n);
;;;161    	else
;;;162    #endif /* ENABLE_HTTPS */
;;;163    		return recv(fd, buf, n, flags);
00000c  463b              MOV      r3,r7
00000e  4632              MOV      r2,r6
000010  4629              MOV      r1,r5
000012  4620              MOV      r0,r4
000014  f7fffffe          BL       recv
;;;164    }
000018  e8bd81f0          POP      {r4-r8,pc}
;;;165    
                          ENDP


                          AREA ||i.httpd_send||, CODE, READONLY, ALIGN=1

                  httpd_send PROC
;;;133     */
;;;134    int httpd_send(int conn, const char *buf, int len)
000000  e92d41f0          PUSH     {r4-r8,lr}
;;;135    {
000004  4607              MOV      r7,r0
000006  460e              MOV      r6,r1
000008  4615              MOV      r5,r2
;;;136    	int num;
;;;137    	do {
00000a  bf00              NOP      
                  |L4.12|
;;;138    #ifdef CONFIG_ENABLE_HTTPS
;;;139    		if (httpd_is_https_active())
;;;140    			num = tls_send(httpd_tls_handle, buf, len);
;;;141    		else
;;;142    #endif /* ENABLE_HTTPS */
;;;143    			num = send(conn, buf, len, 0);
00000c  2300              MOVS     r3,#0
00000e  462a              MOV      r2,r5
000010  4631              MOV      r1,r6
000012  4638              MOV      r0,r7
000014  f7fffffe          BL       send
000018  4604              MOV      r4,r0
;;;144    		if (num < 0) {
00001a  2c00              CMP      r4,#0
00001c  da03              BGE      |L4.38|
;;;145    			httpd_d("send() failed: %d" ,conn);
;;;146    			return -kInProgressErr;
00001e  f04f30ff          MOV      r0,#0xffffffff
                  |L4.34|
;;;147    		}
;;;148    		len -= num;
;;;149    		buf += num;
;;;150    	} while (len > 0);
;;;151    
;;;152    
;;;153    	return kNoErr;
;;;154    }
000022  e8bd81f0          POP      {r4-r8,pc}
                  |L4.38|
000026  1b2d              SUBS     r5,r5,r4              ;148
000028  4426              ADD      r6,r6,r4              ;149
00002a  2d00              CMP      r5,#0                 ;150
00002c  dcee              BGT      |L4.12|
00002e  2000              MOVS     r0,#0                 ;153
000030  e7f7              B        |L4.34|
;;;155    
                          ENDP


                          AREA ||i.httpd_send_chunk||, CODE, READONLY, ALIGN=2

                  httpd_send_chunk PROC
;;;103     */
;;;104    int httpd_send_chunk(int conn, const char *buf, int len)
000000  e92d41f0          PUSH     {r4-r8,lr}
;;;105    {
000004  4606              MOV      r6,r0
000006  460f              MOV      r7,r1
000008  4615              MOV      r5,r2
;;;106    	int err;
;;;107    
;;;108    	if (len) {
00000a  b1d5              CBZ      r5,|L5.66|
;;;109    		/* Send chunk begin header */
;;;110    		err = httpd_send_chunk_begin(conn, len);
00000c  4629              MOV      r1,r5
00000e  4630              MOV      r0,r6
000010  f7fffffe          BL       httpd_send_chunk_begin
000014  4604              MOV      r4,r0
;;;111    		if (err != kNoErr)
000016  b114              CBZ      r4,|L5.30|
;;;112    			return err;
000018  4620              MOV      r0,r4
                  |L5.26|
;;;113    		/* Send our data */
;;;114    		err = httpd_send(conn, buf, len);
;;;115    		if (err != kNoErr)
;;;116    			return err;
;;;117    		/* Send chunk end indicator */
;;;118    		err = httpd_send_crlf(conn);
;;;119    		if (err != kNoErr)
;;;120    			return err;
;;;121    	} else {
;;;122    		/* Length is 0, last chunk */
;;;123    		err = httpd_send(conn, http_last_chunk,
;;;124    				   sizeof(http_last_chunk) - 1);
;;;125    		if (err != kNoErr)
;;;126    			return err;
;;;127    	}
;;;128    
;;;129    	return err;
;;;130    }
00001a  e8bd81f0          POP      {r4-r8,pc}
                  |L5.30|
00001e  462a              MOV      r2,r5                 ;114
000020  4639              MOV      r1,r7                 ;114
000022  4630              MOV      r0,r6                 ;114
000024  f7fffffe          BL       httpd_send
000028  4604              MOV      r4,r0                 ;114
00002a  b10c              CBZ      r4,|L5.48|
00002c  4620              MOV      r0,r4                 ;116
00002e  e7f4              B        |L5.26|
                  |L5.48|
000030  2202              MOVS     r2,#2                 ;118
000032  a109              ADR      r1,|L5.88|
000034  4630              MOV      r0,r6                 ;118
000036  f7fffffe          BL       httpd_send
00003a  4604              MOV      r4,r0                 ;118
00003c  b154              CBZ      r4,|L5.84|
00003e  4620              MOV      r0,r4                 ;120
000040  e7eb              B        |L5.26|
                  |L5.66|
000042  2205              MOVS     r2,#5                 ;123
000044  4905              LDR      r1,|L5.92|
000046  4630              MOV      r0,r6                 ;123
000048  f7fffffe          BL       httpd_send
00004c  4604              MOV      r4,r0                 ;123
00004e  b10c              CBZ      r4,|L5.84|
000050  4620              MOV      r0,r4                 ;126
000052  e7e2              B        |L5.26|
                  |L5.84|
000054  4620              MOV      r0,r4                 ;129
000056  e7e0              B        |L5.26|
;;;131    
                          ENDP

                  |L5.88|
000058  0d0a00            DCB      "\r\n",0
00005b  00                DCB      0
                  |L5.92|
                          DCD      http_last_chunk

                          AREA ||i.httpd_send_chunk_begin||, CODE, READONLY, ALIGN=2

                  httpd_send_chunk_begin PROC
;;;56     #define CHUNK_SIZE_DIGITS 0x10
;;;57     int httpd_send_chunk_begin(int conn, int size)
000000  e92d47ff          PUSH     {r0-r10,lr}
;;;58     {
000004  4680              MOV      r8,r0
000006  460d              MOV      r5,r1
;;;59     
;;;60     	int err;
;;;61     	char buf[CHUNK_SIZE_DIGITS];
;;;62     	int i;
;;;63     	int digit;
;;;64     	int begin = 1;
000008  f04f0901          MOV      r9,#1
;;;65     
;;;66     	for (i = CHUNK_SIZE_DIGITS - 1; i >= 0; i--) {
00000c  240f              MOVS     r4,#0xf
00000e  e015              B        |L6.60|
                  |L6.16|
;;;67     		digit = size & 0xf;
000010  f005060f          AND      r6,r5,#0xf
;;;68     		if (!begin && !size) {
000014  f1b90f00          CMP      r9,#0
000018  d102              BNE      |L6.32|
00001a  b90d              CBNZ     r5,|L6.32|
;;;69     			i++;
00001c  1c64              ADDS     r4,r4,#1
;;;70     			break;
00001e  e00f              B        |L6.64|
                  |L6.32|
;;;71     		}
;;;72     		buf[i] = (digit > 9) ? digit - 0xA + 'a' : digit + '0';
000020  2e09              CMP      r6,#9
000022  dd02              BLE      |L6.42|
000024  f1060057          ADD      r0,r6,#0x57
000028  e001              B        |L6.46|
                  |L6.42|
00002a  f1060030          ADD      r0,r6,#0x30
                  |L6.46|
00002e  b2c0              UXTB     r0,r0
000030  f80d0004          STRB     r0,[sp,r4]
;;;73     		size = size >> 4;
000034  112d              ASRS     r5,r5,#4
;;;74     		begin = 0;
000036  f04f0900          MOV      r9,#0
00003a  1e64              SUBS     r4,r4,#1              ;66
                  |L6.60|
00003c  2c00              CMP      r4,#0                 ;66
00003e  dae7              BGE      |L6.16|
                  |L6.64|
000040  bf00              NOP                            ;70
;;;75     	}
;;;76     	err = httpd_send(conn, &buf[i], CHUNK_SIZE_DIGITS - i);
000042  f1c40210          RSB      r2,r4,#0x10
000046  eb0d0104          ADD      r1,sp,r4
00004a  4640              MOV      r0,r8
00004c  f7fffffe          BL       httpd_send
000050  4607              MOV      r7,r0
;;;77     	if (err != kNoErr) {
000052  b11f              CBZ      r7,|L6.92|
;;;78     		return err;
000054  4638              MOV      r0,r7
                  |L6.86|
;;;79     	}
;;;80     
;;;81     	err = httpd_send_crlf(conn);
;;;82     
;;;83     	return err;
;;;84     }
000056  b004              ADD      sp,sp,#0x10
000058  e8bd87f0          POP      {r4-r10,pc}
                  |L6.92|
00005c  2202              MOVS     r2,#2                 ;81
00005e  a103              ADR      r1,|L6.108|
000060  4640              MOV      r0,r8                 ;81
000062  f7fffffe          BL       httpd_send
000066  4607              MOV      r7,r0                 ;81
000068  4638              MOV      r0,r7                 ;83
00006a  e7f4              B        |L6.86|
;;;85     
                          ENDP

                  |L6.108|
00006c  0d0a00            DCB      "\r\n",0
00006f  00                DCB      0

                          AREA ||i.httpd_send_error||, CODE, READONLY, ALIGN=2

                  httpd_send_error PROC
;;;239     */
;;;240    int httpd_send_error(int conn, int http_error)
000000  e92d41f0          PUSH     {r4-r8,lr}
;;;241    {
000004  4606              MOV      r6,r0
000006  460d              MOV      r5,r1
;;;242    	int err = 0;
000008  2400              MOVS     r4,#0
;;;243    
;;;244    	switch (http_error) {
00000a  b125              CBZ      r5,|L7.22|
00000c  2d01              CMP      r5,#1
00000e  d00d              BEQ      |L7.44|
000010  2d02              CMP      r5,#2
000012  d121              BNE      |L7.88|
000014  e015              B        |L7.66|
                  |L7.22|
;;;245    	case HTTP_404:
;;;246    		err = httpd_send(conn, http_header_404,
000016  482b              LDR      r0,|L7.196|
000018  f7fffffe          BL       strlen
00001c  4607              MOV      r7,r0
00001e  463a              MOV      r2,r7
000020  4928              LDR      r1,|L7.196|
000022  4630              MOV      r0,r6
000024  f7fffffe          BL       httpd_send
000028  4604              MOV      r4,r0
;;;247    				 strlen(http_header_404));
;;;248    		break;
00002a  e015              B        |L7.88|
                  |L7.44|
;;;249    	case HTTP_500:
;;;250    		err = httpd_send(conn, http_header_500,
00002c  4826              LDR      r0,|L7.200|
00002e  f7fffffe          BL       strlen
000032  4607              MOV      r7,r0
000034  463a              MOV      r2,r7
000036  4924              LDR      r1,|L7.200|
000038  4630              MOV      r0,r6
00003a  f7fffffe          BL       httpd_send
00003e  4604              MOV      r4,r0
;;;251    				 strlen(http_header_500));
;;;252    		break;
000040  e00a              B        |L7.88|
                  |L7.66|
;;;253    
;;;254    	case HTTP_505:
;;;255    		err = httpd_send(conn, http_header_505,
000042  4822              LDR      r0,|L7.204|
000044  f7fffffe          BL       strlen
000048  4607              MOV      r7,r0
00004a  463a              MOV      r2,r7
00004c  491f              LDR      r1,|L7.204|
00004e  4630              MOV      r0,r6
000050  f7fffffe          BL       httpd_send
000054  4604              MOV      r4,r0
;;;256    				 strlen(http_header_505));
;;;257    		break;
000056  bf00              NOP      
                  |L7.88|
000058  bf00              NOP                            ;248
;;;258    	}
;;;259    
;;;260    	if (err != kNoErr) {
00005a  b114              CBZ      r4,|L7.98|
;;;261    		return err;
00005c  4620              MOV      r0,r4
                  |L7.94|
;;;262    	}
;;;263    
;;;264    	err = httpd_send(conn, http_header_type_chunked,
;;;265    			strlen(http_header_type_chunked));
;;;266    	if (err != kNoErr) {
;;;267    		return err;
;;;268    	}
;;;269    
;;;270    	err = httpd_send(conn, http_content_type_plain,
;;;271    			 sizeof(http_content_type_plain) - 1);
;;;272    	if (err != kNoErr) {
;;;273    		return err;
;;;274    	}
;;;275    
;;;276    	err = httpd_send_crlf(conn);
;;;277    	if (err != kNoErr) {
;;;278    		return err;
;;;279    	}
;;;280    
;;;281    	err = httpd_send_chunk(conn, httpd_drror, strlen(httpd_drror));
;;;282    	if (err != kNoErr) {
;;;283    		return err;
;;;284    	}
;;;285    	return httpd_send_last_chunk(conn);
;;;286    }
00005e  e8bd81f0          POP      {r4-r8,pc}
                  |L7.98|
000062  481b              LDR      r0,|L7.208|
000064  f7fffffe          BL       strlen
000068  4607              MOV      r7,r0                 ;264
00006a  463a              MOV      r2,r7                 ;264
00006c  4918              LDR      r1,|L7.208|
00006e  4630              MOV      r0,r6                 ;264
000070  f7fffffe          BL       httpd_send
000074  4604              MOV      r4,r0                 ;264
000076  b10c              CBZ      r4,|L7.124|
000078  4620              MOV      r0,r4                 ;267
00007a  e7f0              B        |L7.94|
                  |L7.124|
00007c  221a              MOVS     r2,#0x1a              ;270
00007e  4915              LDR      r1,|L7.212|
000080  4630              MOV      r0,r6                 ;270
000082  f7fffffe          BL       httpd_send
000086  4604              MOV      r4,r0                 ;270
000088  b10c              CBZ      r4,|L7.142|
00008a  4620              MOV      r0,r4                 ;273
00008c  e7e7              B        |L7.94|
                  |L7.142|
00008e  2202              MOVS     r2,#2                 ;276
000090  a111              ADR      r1,|L7.216|
000092  4630              MOV      r0,r6                 ;276
000094  f7fffffe          BL       httpd_send
000098  4604              MOV      r4,r0                 ;276
00009a  b10c              CBZ      r4,|L7.160|
00009c  4620              MOV      r0,r4                 ;278
00009e  e7de              B        |L7.94|
                  |L7.160|
0000a0  480e              LDR      r0,|L7.220|
0000a2  f7fffffe          BL       strlen
0000a6  4607              MOV      r7,r0                 ;281
0000a8  463a              MOV      r2,r7                 ;281
0000aa  490c              LDR      r1,|L7.220|
0000ac  4630              MOV      r0,r6                 ;281
0000ae  f7fffffe          BL       httpd_send_chunk
0000b2  4604              MOV      r4,r0                 ;281
0000b4  b10c              CBZ      r4,|L7.186|
0000b6  4620              MOV      r0,r4                 ;283
0000b8  e7d1              B        |L7.94|
                  |L7.186|
0000ba  4630              MOV      r0,r6                 ;285
0000bc  f7fffffe          BL       httpd_send_last_chunk
0000c0  e7cd              B        |L7.94|
;;;287    
                          ENDP

0000c2  0000              DCW      0x0000
                  |L7.196|
                          DCD      http_header_404
                  |L7.200|
                          DCD      http_header_500
                  |L7.204|
                          DCD      http_header_505
                  |L7.208|
                          DCD      http_header_type_chunked
                  |L7.212|
                          DCD      http_content_type_plain
                  |L7.216|
0000d8  0d0a00            DCB      "\r\n",0
0000db  00                DCB      0
                  |L7.220|
                          DCD      httpd_drror

                          AREA ||i.httpd_send_hdr_from_code||, CODE, READONLY, ALIGN=2

                  httpd_send_hdr_from_code PROC
;;;165    
;;;166    int httpd_send_hdr_from_code(int sock, int stat_code,
000000  e92d41f0          PUSH     {r4-r8,lr}
;;;167    			     enum http_content_type content_type)
;;;168    {
000004  4680              MOV      r8,r0
000006  460e              MOV      r6,r1
000008  4617              MOV      r7,r2
;;;169    	const char *str;
;;;170    	unsigned int str_len;
;;;171    	/*
;;;172    	 * Set the HTTP Response Status 200 OK, 404 NOT FOUND etc.
;;;173    	 * Also set the Transfer-Encoding to chunked.
;;;174    	 */
;;;175    	switch (stat_code) {
00000a  f1160f08          CMN      r6,#8
00000e  d011              BEQ      |L8.52|
000010  f1160f07          CMN      r6,#7
000014  d008              BEQ      |L8.40|
000016  f1160f06          CMN      r6,#6
00001a  d111              BNE      |L8.64|
;;;176    	case -WM_E_HTTPD_HANDLER_404:
;;;177    		str = http_header_404;
00001c  4d23              LDR      r5,|L8.172|
;;;178    		str_len = strlen(http_header_404);
00001e  4628              MOV      r0,r5
000020  f7fffffe          BL       strlen
000024  4604              MOV      r4,r0
;;;179    		break;
000026  e011              B        |L8.76|
                  |L8.40|
;;;180    	case -WM_E_HTTPD_HANDLER_400:
;;;181    		str = http_header_400;
000028  4d21              LDR      r5,|L8.176|
;;;182    		str_len = strlen(http_header_400);
00002a  4628              MOV      r0,r5
00002c  f7fffffe          BL       strlen
000030  4604              MOV      r4,r0
;;;183    		break;
000032  e00b              B        |L8.76|
                  |L8.52|
;;;184    	case -WM_E_HTTPD_HANDLER_500:
;;;185    		str = http_header_500;
000034  4d1f              LDR      r5,|L8.180|
;;;186    		str_len = strlen(http_header_500);
000036  4628              MOV      r0,r5
000038  f7fffffe          BL       strlen
00003c  4604              MOV      r4,r0
;;;187    		break;
00003e  e005              B        |L8.76|
                  |L8.64|
;;;188    	default:
;;;189    		/* The handler doesn't want an HTTP error code, but would return
;;;190    		 * 200 OK with an error in the response */
;;;191    		str = http_header_200;
000040  4d1d              LDR      r5,|L8.184|
;;;192    		str_len = strlen(http_header_200);
000042  4628              MOV      r0,r5
000044  f7fffffe          BL       strlen
000048  4604              MOV      r4,r0
;;;193    		break;
00004a  bf00              NOP      
                  |L8.76|
00004c  bf00              NOP                            ;179
;;;194    	}
;;;195    
;;;196    	if (httpd_send(sock, str, str_len) != kNoErr) {
00004e  4622              MOV      r2,r4
000050  4629              MOV      r1,r5
000052  4640              MOV      r0,r8
000054  f7fffffe          BL       httpd_send
000058  b118              CBZ      r0,|L8.98|
;;;197    		return -kInProgressErr;
00005a  f04f30ff          MOV      r0,#0xffffffff
                  |L8.94|
;;;198    	}
;;;199    
;;;200    	/* Send the Content-Type */
;;;201    	switch (content_type) {
;;;202    	case HTTP_CONTENT_JSON:
;;;203    		str = http_content_type_json_nocache;
;;;204    		str_len = sizeof(http_content_type_json_nocache) - 1;
;;;205    		break;
;;;206    	case HTTP_CONTENT_XML:
;;;207    		str = http_content_type_xml_nocache;
;;;208    		str_len = sizeof(http_content_type_xml_nocache) - 1;
;;;209    		break;
;;;210    	case HTTP_CONTENT_HTML:
;;;211    		str = http_content_type_html;
;;;212    		str_len = sizeof(http_content_type_html) - 1;
;;;213    		break;
;;;214    	case HTTP_CONTENT_JPEG:
;;;215    		str = http_content_type_jpg;
;;;216    		str_len = sizeof(http_content_type_jpg) - 1;
;;;217    		break;
;;;218    	default:
;;;219    		str = http_content_type_plain;
;;;220    		str_len = sizeof(http_content_type_plain) - 1;
;;;221    		break;
;;;222    	}
;;;223    	if (httpd_send(sock, str, str_len) != kNoErr) {
;;;224    		return -kInProgressErr;
;;;225    	}
;;;226    	return kNoErr;
;;;227    }
00005e  e8bd81f0          POP      {r4-r8,pc}
                  |L8.98|
000062  2f01              CMP      r7,#1                 ;201
000064  d006              BEQ      |L8.116|
000066  2f02              CMP      r7,#2                 ;201
000068  d007              BEQ      |L8.122|
00006a  2f03              CMP      r7,#3                 ;201
00006c  d008              BEQ      |L8.128|
00006e  2f04              CMP      r7,#4                 ;201
000070  d10c              BNE      |L8.140|
000072  e008              B        |L8.134|
                  |L8.116|
000074  4d11              LDR      r5,|L8.188|
000076  2492              MOVS     r4,#0x92              ;204
000078  e00b              B        |L8.146|
                  |L8.122|
00007a  4d11              LDR      r5,|L8.192|
00007c  248a              MOVS     r4,#0x8a              ;208
00007e  e008              B        |L8.146|
                  |L8.128|
000080  4d10              LDR      r5,|L8.196|
000082  242c              MOVS     r4,#0x2c              ;212
000084  e005              B        |L8.146|
                  |L8.134|
000086  4d10              LDR      r5,|L8.200|
000088  241a              MOVS     r4,#0x1a              ;216
00008a  e002              B        |L8.146|
                  |L8.140|
00008c  4d0f              LDR      r5,|L8.204|
00008e  241a              MOVS     r4,#0x1a              ;220
000090  bf00              NOP                            ;221
                  |L8.146|
000092  bf00              NOP                            ;205
000094  4622              MOV      r2,r4                 ;223
000096  4629              MOV      r1,r5                 ;223
000098  4640              MOV      r0,r8                 ;223
00009a  f7fffffe          BL       httpd_send
00009e  b110              CBZ      r0,|L8.166|
0000a0  f04f30ff          MOV      r0,#0xffffffff        ;224
0000a4  e7db              B        |L8.94|
                  |L8.166|
0000a6  2000              MOVS     r0,#0                 ;226
0000a8  e7d9              B        |L8.94|
;;;228    
                          ENDP

0000aa  0000              DCW      0x0000
                  |L8.172|
                          DCD      http_header_404
                  |L8.176|
                          DCD      http_header_400
                  |L8.180|
                          DCD      http_header_500
                  |L8.184|
                          DCD      http_header_200
                  |L8.188|
                          DCD      http_content_type_json_nocache
                  |L8.192|
                          DCD      http_content_type_xml_nocache
                  |L8.196|
                          DCD      http_content_type_html
                  |L8.200|
                          DCD      http_content_type_jpg
                  |L8.204|
                          DCD      http_content_type_plain

                          AREA ||i.httpd_send_last_chunk||, CODE, READONLY, ALIGN=2

                  httpd_send_last_chunk PROC
;;;87      */
;;;88     int httpd_send_last_chunk(int conn)
000000  b570              PUSH     {r4-r6,lr}
;;;89     {
000002  4604              MOV      r4,r0
;;;90     	int err;
;;;91     
;;;92     	err = httpd_send(conn, http_last_chunk,
000004  2205              MOVS     r2,#5
000006  4903              LDR      r1,|L9.20|
000008  4620              MOV      r0,r4
00000a  f7fffffe          BL       httpd_send
00000e  4605              MOV      r5,r0
;;;93     			    sizeof(http_last_chunk) - 1);
;;;94     
;;;95     	if (err != kNoErr) {
;;;96     		httpd_d("Send last chunk failed");
;;;97     	}
;;;98     
;;;99     	return err;
000010  4628              MOV      r0,r5
;;;100    }
000012  bd70              POP      {r4-r6,pc}
;;;101    
                          ENDP

                  |L9.20|
                          DCD      http_last_chunk

                          AREA ||i.httpd_set_error||, CODE, READONLY, ALIGN=1

                  httpd_set_error PROC
;;;232    static char httpd_drror[HTTPD_MAX_ERROR_STRING + 1];
;;;233    void httpd_set_error(const char *fmt, ...)
000000  4770              BX       lr
;;;234    {
;;;235    	httpd_d("http set err");
;;;236    }
;;;237    
                          ENDP


                          AREA ||.bss||, DATA, NOINIT, ALIGN=2

                  httpd_req
                          %        356
                  httpd_drror
                          %        257

;*** Start embedded assembler ***

#line 1 "..\\..\\..\\..\\libraries\\daemons\\http_server\\httpd_handle.c"
	AREA ||.rev16_text||, CODE
	THUMB
	EXPORT |__asm___14_httpd_handle_c_0cf18ac3____REV16|
#line 114 "..\\..\\..\\..\\Platform\\Cortex-M4\\CMSIS\\core_cmInstr.h"
|__asm___14_httpd_handle_c_0cf18ac3____REV16| PROC
#line 115

 rev16 r0, r0
 bx lr
	ENDP
	AREA ||.revsh_text||, CODE
	THUMB
	EXPORT |__asm___14_httpd_handle_c_0cf18ac3____REVSH|
#line 128
|__asm___14_httpd_handle_c_0cf18ac3____REVSH| PROC
#line 129

 revsh r0, r0
 bx lr
	ENDP

;*** End   embedded assembler ***
