Subversion Repositories Kolibri OS

Rev

Rev 7971 | Rev 8570 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7971 Rev 8023
Line 132... Line 132...
132
;? Get HTTP buffer size                                                                           ;;
132
;? Get HTTP buffer size                                                                           ;;
133
;;------------------------------------------------------------------------------------------------;;
133
;;------------------------------------------------------------------------------------------------;;
134
;< eax = buffer size in bytes                                                                     ;;
134
;< eax = buffer size in bytes                                                                     ;;
135
;;================================================================================================;;
135
;;================================================================================================;;
Line 136... Line 136...
136
 
136
 
137
        mov     eax, BUFFERSIZE
137
        mov     eax, [buffersize]
Line 138... Line 138...
138
        ret
138
        ret
Line 139... Line 139...
139
 
139
 
Line 145... Line 145...
145
;? Set HTTP buffer size                                                                           ;;
145
;? Set HTTP buffer size                                                                           ;;
146
;;------------------------------------------------------------------------------------------------;;
146
;;------------------------------------------------------------------------------------------------;;
147
;> eax = buffer size in bytes                                                                     ;;
147
;> eax = buffer size in bytes                                                                     ;;
148
;;================================================================================================;;
148
;;================================================================================================;;
Line 149... Line 149...
149
 
149
 
150
;        mov     [BUFFERSIZE], eax
150
        mov     [buffersize], eax
Line 151... Line 151...
151
        ret
151
        ret
Line 1023... Line 1023...
1023
  .header_parsed:
1023
  .header_parsed:
1024
        ; If we're using ring buffer, check we crossed the boundary
1024
        ; If we're using ring buffer, check we crossed the boundary
1025
        test    [ebp + http_msg.flags], FLAG_RING
1025
        test    [ebp + http_msg.flags], FLAG_RING
1026
        jz      @f
1026
        jz      @f
1027
        mov     ebx, [ebp + http_msg.content_ptr]
1027
        mov     ebx, [ebp + http_msg.content_ptr]
1028
        add     ebx, BUFFERSIZE
1028
        add     ebx, [buffersize]
1029
        cmp     [ebp + http_msg.write_ptr], ebx
1029
        cmp     [ebp + http_msg.write_ptr], ebx
1030
        jb      @f
1030
        jb      @f
1031
        DEBUGF  1, "Restarting at beginning of ring buffer\n"
1031
        DEBUGF  1, "Restarting at beginning of ring buffer\n"
-
 
1032
        mov     ebx, [buffersize]
1032
        sub     [ebp + http_msg.write_ptr], BUFFERSIZE
1033
        sub     [ebp + http_msg.write_ptr], ebx
1033
  @@:
1034
  @@:
1034
        ; Header was already parsed and connection isnt chunked.
1035
        ; Header was already parsed and connection isnt chunked.
1035
        ; Update content_received
1036
        ; Update content_received
1036
        add     [ebp + http_msg.content_received], eax
1037
        add     [ebp + http_msg.content_received], eax
1037
        ; If we received content-length parameter, check if we received all the data
1038
        ; If we received content-length parameter, check if we received all the data
Line 1085... Line 1086...
1085
  .need_more_data_chunked:
1086
  .need_more_data_chunked:
1086
; If we're using ring buffer, check we crossed the boundary
1087
; If we're using ring buffer, check we crossed the boundary
1087
        test    [ebp + http_msg.flags], FLAG_RING
1088
        test    [ebp + http_msg.flags], FLAG_RING
1088
        jz      @f
1089
        jz      @f
1089
        mov     ebx, [ebp + http_msg.content_ptr]
1090
        mov     ebx, [ebp + http_msg.content_ptr]
1090
        add     ebx, BUFFERSIZE
1091
        add     ebx, [buffersize]
1091
        cmp     [ebp + http_msg.write_ptr], ebx
1092
        cmp     [ebp + http_msg.write_ptr], ebx
1092
        jb      @f
1093
        jb      @f
1093
        DEBUGF  1, "Restarting at beginning of ring buffer\n"
1094
        DEBUGF  1, "Restarting at beginning of ring buffer\n"
-
 
1095
        mov     ebx, [buffersize]
1094
        sub     [ebp + http_msg.write_ptr], BUFFERSIZE
1096
        sub     [ebp + http_msg.write_ptr], ebx
1095
  @@:
1097
  @@:
1096
        ; We only got a partial chunk, or need more chunks, update content_received and request more data
1098
        ; We only got a partial chunk, or need more chunks, update content_received and request more data
1097
        add     [ebp + http_msg.content_received], eax
1099
        add     [ebp + http_msg.content_received], eax
1098
        popa
1100
        popa
1099
        xor     eax, eax
1101
        xor     eax, eax
Line 1136... Line 1138...
1136
        dec     eax
1138
        dec     eax
1137
        ret
1139
        ret
Line 1138... Line 1140...
1138
 
1140
 
1139
  .server_closed:
1141
  .server_closed:
-
 
1142
        DEBUGF  1, "server closed connection, transfer complete?\n"
-
 
1143
        mcall   close, [ebp + http_msg.socket]
1140
        DEBUGF  1, "server closed connection, transfer complete?\n"
1144
        and     [ebp + http_msg.flags], not FLAG_CONNECTED
1141
        test    [ebp + http_msg.flags], FLAG_GOT_HEADER
1145
        test    [ebp + http_msg.flags], FLAG_GOT_HEADER
1142
        jz      .err_server_closed
1146
        jz      .err_server_closed
1143
        test    [ebp + http_msg.flags], FLAG_CONTENT_LENGTH
1147
        test    [ebp + http_msg.flags], FLAG_CONTENT_LENGTH
1144
        jz      .got_all_data
1148
        jz      .got_all_data