Subversion Repositories Kolibri OS

Rev

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

Rev 7101 Rev 7296
Line 21... Line 21...
21
        URLMAXLEN       = 65535
21
        URLMAXLEN       = 65535
22
        BUFFERSIZE      = 8192
22
        BUFFERSIZE      = 8192
23
        TIMEOUT         = 500  ; in 1/100 s
23
        TIMEOUT         = 500  ; in 1/100 s
Line 24... Line 24...
24
 
24
 
25
        __DEBUG__       = 1
25
        __DEBUG__       = 1
Line 26... Line 26...
26
        __DEBUG_LEVEL__ = 2
26
        __DEBUG_LEVEL__ = 1
Line 27... Line 27...
27
 
27
 
Line 478... Line 478...
478
        socketnum       dd ?
478
        socketnum       dd ?
479
        buffer          dd ?
479
        buffer          dd ?
480
        port            dd ?
480
        port            dd ?
481
endl
481
endl
Line -... Line 482...
-
 
482
 
-
 
483
        DEBUGF  1, "HTTP POST (%s).\n", [URL]
482
 
484
 
Line 483... Line 485...
483
        and     [flags], 0xff00       ; filter out invalid flags
485
        and     [flags], 0xff00       ; filter out invalid flags
484
 
486
 
485
        pusha
487
        pusha
Line 500... Line 502...
500
        mov     [socketnum], eax
502
        mov     [socketnum], eax
501
        jmp     .send_request
503
        jmp     .send_request
Line 502... Line 504...
502
 
504
 
503
; Connect to the other side.
505
; Connect to the other side.
-
 
506
  .open_new:
504
  .open_new:
507
        DEBUGF  1, "Opening new connection.\n"
505
        stdcall open_connection, [hostname], [port]
508
        stdcall open_connection, [hostname], [port]
506
        test    eax, eax
509
        test    eax, eax
507
        jz      .error
510
        jz      .error
Line 598... Line 601...
598
        mov     [buffer], eax
601
        mov     [buffer], eax
599
  .new_connection:
602
  .new_connection:
600
        HTTP_init_buffer [buffer], [socketnum], [flags]
603
        HTTP_init_buffer [buffer], [socketnum], [flags]
601
        popa
604
        popa
602
        mov     eax, [buffer]   ; return buffer ptr
605
        mov     eax, [buffer]   ; return buffer ptr
-
 
606
        DEBUGF  1, "HTTP POST complete.\n"
603
        ret
607
        ret
Line 604... Line 608...
604
 
608
 
605
  .error:
609
  .error:
606
        DEBUGF  2, "HTTP POST error!\n"
610
        DEBUGF  2, "HTTP POST error!\n"
Line 1911... Line 1915...
1911
  .length       = $ - str_post_cl
1915
  .length       = $ - str_post_cl
1912
str_post_ct     db 13, 10, 'Content-Type: '
1916
str_post_ct     db 13, 10, 'Content-Type: '
1913
  .length       = $ - str_post_ct
1917
  .length       = $ - str_post_ct
1914
str_proxy_auth  db 13, 10, 'Proxy-Authorization: Basic '
1918
str_proxy_auth  db 13, 10, 'Proxy-Authorization: Basic '
1915
  .length       = $ - str_proxy_auth
1919
  .length       = $ - str_proxy_auth
1916
str_close       db 'User-Agent: KolibriOS libHTTP/1.1', 13, 10, 'Connection: Close', 13, 10, 13, 10
1920
str_close       db 'User-Agent: KolibriOS libHTTP/1.1', 13, 10, 'Connection: close', 13, 10, 13, 10
1917
  .length       = $ - str_close
1921
  .length       = $ - str_close
1918
str_keep        db 'User-Agent: KolibriOS libHTTP/1.1', 13, 10, 'Connection: Keepalive', 13, 10, 13, 10
1922
str_keep        db 'User-Agent: KolibriOS libHTTP/1.1', 13, 10, 'Connection: keep-alive', 13, 10, 13, 10
1919
  .length       = $ - str_keep
1923
  .length       = $ - str_keep
Line 1920... Line 1924...
1920
 
1924
 
Line 1921... Line 1925...
1921
str_http        db 'http://', 0
1925
str_http        db 'http://', 0