Search found 96 matches

by DarkPlayer
Tue Jul 02, 2013 10:04 pm
Forum: Tricks 'n' Tips
Topic: HTTP Library (Crossplatform, GET/HEAD/POST, chunked, gzip)
Replies: 28
Views: 23833

Re: HTTP Library (Crossplatform, GET/HEAD/POST, chunked, gzi

Hello,

the SimpleHTTP_Post() functions are not suitable for file upload.

There are several reasons for this: Uploading a file does often take some time and the SimpleHTTP would cause your program to freeze until all post data is sent. The better approach would be to show some progress to the user ...
by DarkPlayer
Sat Jun 22, 2013 6:44 pm
Forum: Tricks 'n' Tips
Topic: HTTP Library (Crossplatform, GET/HEAD/POST, chunked, gzip)
Replies: 28
Views: 23833

Re: HTTP Library (Crossplatform, GET/HEAD/POST, chunked, gzi

Hi,

sorry that I did not see your bug report earlier, somehow the board did not send me an email notification.

Nevertheless you are right, the RSet() command from PB, which I used in encodeURL_UTF8() did not work in all cases as expected and caused this bug. I replaced it with a different command ...
by DarkPlayer
Sat Jun 15, 2013 9:23 pm
Forum: Tricks 'n' Tips
Topic: HTTP Library (Crossplatform, GET/HEAD/POST, chunked, gzip)
Replies: 28
Views: 23833

Re: HTTP Library (Crossplatform, GET/HEAD/POST, chunked, gzi

Hi,

your specified website's content size differs on every request. If I execute "wget -O /dev/null http://www.avito.ru/novosibirsk" I always get a different size shown. Do you experience the same problem with a static page? If yes, you should check if you have the PB-DisconnectEvent workaround ...
by DarkPlayer
Sat Jun 15, 2013 5:24 pm
Forum: Tricks 'n' Tips
Topic: HTTP Library (Crossplatform, GET/HEAD/POST, chunked, gzip)
Replies: 28
Views: 23833

Re: HTTP Library (Crossplatform, GET/HEAD/POST, chunked, gzi

Hi,

thanks for the feedback. You indeed discovered a small bug. The problem was not related to multipart post, but instead to the handling of POST-redirect requests. The specification says that the destination of the redirect should be queried using a GET request for statuscodes 301 and 302, this ...
by DarkPlayer
Sat Apr 27, 2013 2:34 pm
Forum: Linux
Topic: Alternative for ReceiveHTTPFile on Linux?
Replies: 3
Views: 2732

Re: Alternative for ReceiveHTTPFile on Linux?

Hi,

you can check my HTTP library: http://www.purebasic.fr/english/viewtopic.php?f=12&t=54297 .

It is fully written in PureBasic, but uses some API tricks to workaround the issues/bugs of the PB Network stack, and should work on Windows, Linux and MacOS X. You should take a look at the SimpleHTTP ...
by DarkPlayer
Fri Apr 12, 2013 10:19 pm
Forum: Tricks 'n' Tips
Topic: HTTP Library (Crossplatform, GET/HEAD/POST, chunked, gzip)
Replies: 28
Views: 23833

Re: HTTP Library (Crossplatform, GET/HEAD/POST, chunked, gzi

I added a non blocking download dialog in the package. You can now create a download dialog which shows the user the current progress of the download. You can also add multiple files and check the status of each file.

The window is not modal or blocking, you can continue to use your current code to ...
by DarkPlayer
Thu Apr 11, 2013 2:00 pm
Forum: Tricks 'n' Tips
Topic: Workaround for bugs in NetworkClientEvent()
Replies: 6
Views: 4967

Workaround for bugs in NetworkClientEvent()

Hi,

recently I wrote a small HTTP library only with PureBasic commands, but unfortunately I discovered several bugs in the implementations of NetworkClientEvent on all platforms when trying to detect the disconnect event. I had no time to track them down all, but in the meantime you can use the ...
by DarkPlayer
Thu Apr 11, 2013 3:37 am
Forum: Tricks 'n' Tips
Topic: Proper HTTP GET&POST(cross-platform,chunking etc..)
Replies: 20
Views: 4504

Re: Proper HTTP GET&POST(cross-platform,chunking etc..)


I wrote it in a few hours, sorry if it doesn't meet up to the standards of all your contributions.. oh wait
[...]
I've searched these forums and PB archives, if you know of a more complete and/or stable solution please DO share...
I have written one today, you can find it here: http://www ...
by DarkPlayer
Thu Apr 11, 2013 3:33 am
Forum: Tricks 'n' Tips
Topic: HTTP Library (Crossplatform, GET/HEAD/POST, chunked, gzip)
Replies: 28
Views: 23833

HTTP Library (Crossplatform, GET/HEAD/POST, chunked, gzip)

Hi,

I was looking for a small HTTP library fully written in PureBasic which is able to handle features like chunked data transfer encoding or gzip compression, but unfortunately most other user-written implementations only implement a very minimal set of features (or are simply broken) - so I ...
by DarkPlayer
Wed Apr 10, 2013 2:27 am
Forum: Tricks 'n' Tips
Topic: Proper HTTP GET&POST(cross-platform,chunking etc..)
Replies: 20
Views: 4504

Re: Proper HTTP GET&POST(cross-platform,chunking etc..)

Hello tj1010,

i just took a closer look at your code and found some flaws which should not be inside a code offering proper HTTP handling.

First of all, you should check for the #PB_NetworkEvent_Disconnect event and disable keep alive. This allows you to detect a closed connection without waiting ...
by DarkPlayer
Fri Jan 11, 2013 9:27 pm
Forum: Assembly and C Programming in PureBasic
Topic: How to call PureBasic procedures using assembly
Replies: 2
Views: 5022

Re: How to call PureBasic procedures using assembly

I created an example for Linux 64 Bit and used the following assembler code:

extern PB_OpenConsole
extern PB_Input

global testcode

SECTION .text
testcode:
call PB_OpenConsole
cmp rax, 0
je .end
call PB_Input
.end:
ret

compiled with nasm
nasm -o test.o -f elf64 test.asm
and this PB code ...
by DarkPlayer
Sat Nov 03, 2012 1:06 am
Forum: Coding Questions
Topic: PB daemon to process AJAX calls
Replies: 6
Views: 2430

Re: PB daemon to process AJAX calls

Hi,

I would not recommed you to write your own HTTP server as it's much more complicated than you might think in the first moment. The HTTP 1.1 Protocol does support many features like chunked data transfers, range requests, If Modified Since requests and many more things. You don't need to ...
by DarkPlayer
Fri Sep 21, 2012 3:31 pm
Forum: Tricks 'n' Tips
Topic: [crossplatform] Disconnect Event for Client
Replies: 16
Views: 11245

Re: [crossplatform] Disconnect Event for Client

Hi,

this is no error. If you compile the following C code:

#include <stdio.h>
#include <sys/select.h>

int main(){
printf("Size of FD_SET: %d\n", sizeof(fd_set));
}

for 32 and 64 bit, you will see that the size is always 128.

We are using bits and it's irrelevant if we are always using ...
by DarkPlayer
Sun Aug 19, 2012 12:19 am
Forum: Windows
Topic: Thoughts on what is fastest form of IPC?
Replies: 7
Views: 3443

Re: Thoughts on what is fastest form of IPC?

The fastest form of IPC is shared memory, because the operating system just maps two virtual addresses to the same physical page. Both processes just read and write the same physical memory and there is no need to copy the data between them. The disadvantage of shared memory is that you have to ...
by DarkPlayer
Wed Aug 08, 2012 5:10 pm
Forum: Windows
Topic: Strange problem with FFMPEG's stdout
Replies: 16
Views: 15568

Re: Strange problem with FFMPEG's stdout

I think your problem is that FFMPEG can't find your input file.
Depeding on your compiler settings, the working directory might be C:\Program Files\Purebasic, if you start your program within the IDE. Just try an absolut path for the input file.
The reason why you can't see an error in the program ...