1118,15 → 1118,19 |
|
|
;;================================================================================================;; |
proc URI_escape URI ;/////////////////////////////////////////////////////////////////////////////;; |
proc HTTP_escape URI ;////////////////////////////////////////////////////////////////////////////;; |
;;------------------------------------------------------------------------------------------------;; |
;? ;; |
;;------------------------------------------------------------------------------------------------;; |
;> URI = ptr to ASCIIZ URI ;; |
;;------------------------------------------------------------------------------------------------;; |
;< eax = 0 (error) / ptr to ASCIIZ URI ;; |
;< eax = 0 (error) / ptr to ASCIIZ URI/data ;; |
;< ebx = length of escaped URI/data ;; |
;;================================================================================================;; |
|
|
; TODO: instead of static buffer allocation, make it 4096 bytes and larger only if needed |
|
pusha |
|
invoke mem.alloc, URLMAXLEN |
1145,7 → 1149,8 |
mov cl, al |
and cl, 0x1f |
mov bl, al |
shr bl, 5 |
shr bl, 3 |
and bl, not 3 |
bt dword[bits_must_escape + ebx], ecx |
jc .escape |
|
1168,6 → 1173,9 |
|
.done: |
stosb |
sub edi, [esp + 7 * 4] |
dec edi |
mov [esp + 4 * 4], edi |
|
popa |
ret |
1182,7 → 1190,7 |
|
|
;;================================================================================================;; |
proc URI_unescape URI ;///////////////////////////////////////////////////////////////////////////;; |
proc HTTP_unescape URI ;//////////////////////////////////////////////////////////////////////////;; |
;;------------------------------------------------------------------------------------------------;; |
;? ;; |
;;------------------------------------------------------------------------------------------------;; |
1687,8 → 1695,8 |
HTTP_process , 'process' , \ |
HTTP_free , 'free' , \ |
HTTP_stop , 'stop' , \ |
URI_escape , 'escape' , \ |
URI_unescape , 'unescape' |
HTTP_escape , 'escape' , \ |
HTTP_unescape , 'unescape' |
|
; HTTP_put , 'put' , \ |
; HTTP_delete , 'delete' , \ |