Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions http/http.tbh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
#define HTTP_TIMEOUT 30
#endif

#ifndef HTTP_MAX_CONCURRENT 'number of HTTP requests that can run at the same time
#define HTTP_MAX_CONCURRENT 3
#endif

#ifndef HTTP_TLS_BUFF_PAGES
#define HTTP_TLS_BUFF_PAGES 40
#endif
Expand Down Expand Up @@ -78,7 +82,13 @@ type http_request_type
chunked as boolean
method as HTTP_REQUEST_METHODS
interface as pl_sock_interfaces

'per-request transient state (kept here so concurrent requests don't clobber each other)
header_end as string(4)
header_name as string(50)
header_value as string(50)
chunk_length as dword
timer_count as dword

end type

declare function http_request(method as HTTP_REQUEST_METHODS, byref url as string, interface as pl_sock_interfaces, byref data as string) as byte
Expand Down Expand Up @@ -111,4 +121,5 @@ declare sub callback_http_request_complete()
declare sub callback_http_request_failed(byref error_message as string)
declare sub callback_http_send_headers()

declare http_request_item as http_request_type
declare http_request_item as http_request_type
declare http_requests as http_request_type(HTTP_MAX_CONCURRENT)
Loading
Loading