2010-04-13 09:29:04     Problem with boa server (CGI script)

Document created by Aaronwu Employee on Aug 21, 2013
Version 1Show Document
  • View in full screen mode

2010-04-13 09:29:04     Problem with boa server (CGI script)

Cedric Marin (FRANCE)

Message: 88375   


Hi everybody,


I'm working with a BF548 module plugged on a DEV-BF548-Lite card from Bluetechnix. I installed uClinux 2009-R1.1-RC4 on it and all works fine.


I have just a problem with the boa server and more precisely with the CGI scripts. I notice that when I use a CGI script to load a file (an image for exemple), there is a problem when the file size is superior to 65ko. For little file, it works perfectly ! The script blocks when writing data over stdout. The source code of the script for a jpeg image is given in the follwing :


int main(int argc,char *argv[]) {

    FILE *file;

    struct stat file_info;

    int size;

    int flag;

    unsigned char *buffer;


    printf("Content-type: image/jpeg\n\n");


    flag = stat("/tmp/test/image.jpg",&file_info);


    size = file_info.st_size;


    file = fopen("/tmp/test/image.jpg","rb");


    buffer = (unsigned char *)calloc(size,sizeof(unsigned char));


    flag = fread(buffer,size,sizeof(unsigned char),file);


    flag = fwrite(buffer,size,sizeof(unsigned char),stdout);







The code is very simple and I notice that the process locks on the fwrite function call. Is there any limitation in file size with CGI script when using boa ? Is anybody known how I can resolve this problem ?


Thanks in advance.


Cedric Marin




2010-04-13 14:48:14     Re: Problem with boa server (CGI script)

Mike Frysinger (UNITED STATES)

Message: 88381   


this bug should already be fixed in trunk






2010-04-14 03:33:28     Re: Problem with boa server (CGI script)

Cedric Marin (FRANCE)

Message: 88417   


Hi Mike,


thanks for your quick answer! I will patch boa.


I currently resolved the problem by using the alias option of Boa (I no longer use CGI scripts to load images).