Subversion Repositories Kolibri OS

Rev

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

Rev 4830 Rev 4831
Line 1116... Line 1116...
1116
endp
1116
endp
Line 1117... Line 1117...
1117
 
1117
 
1118
 
1118
 
1119
 
1119
 
1120
;;================================================================================================;;
1120
;;================================================================================================;;
1121
proc URI_escape URI ;/////////////////////////////////////////////////////////////////////////////;;
1121
proc HTTP_escape URI ;////////////////////////////////////////////////////////////////////////////;;
1122
;;------------------------------------------------------------------------------------------------;;
1122
;;------------------------------------------------------------------------------------------------;;
1123
;?                                                                                                ;;
1123
;?                                                                                                ;;
1124
;;------------------------------------------------------------------------------------------------;;
1124
;;------------------------------------------------------------------------------------------------;;
-
 
1125
;> URI = ptr to ASCIIZ URI                                                                        ;;
1125
;> URI = ptr to ASCIIZ URI                                                                        ;;
1126
;;------------------------------------------------------------------------------------------------;;
Line -... Line 1127...
-
 
1127
;< eax = 0 (error) / ptr to ASCIIZ URI/data                                                       ;;
-
 
1128
;< ebx = length of escaped URI/data                                                               ;;
-
 
1129
;;================================================================================================;;
1126
;;------------------------------------------------------------------------------------------------;;
1130
 
Line 1127... Line 1131...
1127
;< eax = 0 (error) / ptr to ASCIIZ URI                                                            ;;
1131
 
1128
;;================================================================================================;;
1132
; TODO: instead of static buffer allocation, make it 4096 bytes and larger only if needed
1129
 
1133
 
Line 1143... Line 1147...
1143
        jz      .done
1147
        jz      .done
Line 1144... Line 1148...
1144
 
1148
 
1145
        mov     cl, al
1149
        mov     cl, al
1146
        and     cl, 0x1f
1150
        and     cl, 0x1f
1147
        mov     bl, al
1151
        mov     bl, al
-
 
1152
        shr     bl, 3
1148
        shr     bl, 5
1153
        and     bl, not 3
1149
        bt      dword[bits_must_escape + ebx], ecx
1154
        bt      dword[bits_must_escape + ebx], ecx
Line 1150... Line 1155...
1150
        jc      .escape
1155
        jc      .escape
1151
 
1156
 
Line 1166... Line 1171...
1166
        jmp     .loop
1171
        jmp     .loop
Line 1167... Line 1172...
1167
 
1172
 
1168
 
1173
 
-
 
1174
  .done:
-
 
1175
        stosb
-
 
1176
        sub     edi, [esp + 7 * 4]
Line 1169... Line 1177...
1169
  .done:
1177
        dec     edi
1170
        stosb
1178
        mov     [esp + 4 * 4], edi
Line 1171... Line 1179...
1171
 
1179
 
Line 1180... Line 1188...
1180
endp
1188
endp
Line 1181... Line 1189...
1181
 
1189
 
1182
 
1190
 
1183
 
1191
 
1184
;;================================================================================================;;
1192
;;================================================================================================;;
1185
proc URI_unescape URI ;///////////////////////////////////////////////////////////////////////////;;
1193
proc HTTP_unescape URI ;//////////////////////////////////////////////////////////////////////////;;
1186
;;------------------------------------------------------------------------------------------------;;
1194
;;------------------------------------------------------------------------------------------------;;
1187
;?                                                                                                ;;
1195
;?                                                                                                ;;
Line 1685... Line 1693...
1685
        HTTP_post               , 'post'                , \
1693
        HTTP_post               , 'post'                , \
1686
        HTTP_find_header_field  , 'find_header_field'   , \
1694
        HTTP_find_header_field  , 'find_header_field'   , \
1687
        HTTP_process            , 'process'             , \
1695
        HTTP_process            , 'process'             , \
1688
        HTTP_free               , 'free'                , \
1696
        HTTP_free               , 'free'                , \
1689
        HTTP_stop               , 'stop'                , \
1697
        HTTP_stop               , 'stop'                , \
1690
        URI_escape              , 'escape'              , \
1698
        HTTP_escape             , 'escape'              , \
1691
        URI_unescape            , 'unescape'
1699
        HTTP_unescape           , 'unescape'
Line 1692... Line 1700...
1692
 
1700
 
1693
;        HTTP_put                , 'put'                 , \
1701
;        HTTP_put                , 'put'                 , \
1694
;        HTTP_delete             , 'delete'              , \
1702
;        HTTP_delete             , 'delete'              , \
1695
;        HTTP_trace              , 'trace'               , \
1703
;        HTTP_trace              , 'trace'               , \