Code Monkey home page Code Monkey logo

Comments (4)

mfvargo avatar mfvargo commented on June 12, 2024

I did some printf debugging today. I see the spot in request.cpp where it calls the error handler. I put a printt() above that like this:

if(m_environment.postBuffer().size()+(bodyEnd-body)
                            > environment().contentLength)
                    {
                        printf("IN: postBuffer: %hu, environment().contentLength: %hu\n", 
                            m_environment.postBuffer().size()+(bodyEnd-body),
                            environment().contentLength
                        );
                        bigPostErrorHandler();

and saw this in my output

IN: postBuffer: 91, environment().contentLength: 0

I'm not sure what sets environment().contentLength but I'm looking into that.

I'm pretty sure this has something to do with my nginx fastcgi setup but have not worked it out yet. Any help is appreciated.

from fastcgipp.

eddic avatar eddic commented on June 12, 2024

Ah interesting. A few things might be happening. Either nginx is stripping the content-length header or the client isn't sending it at all. This code here is basically just rejecting badly formed POST queries. It saying "The client is trying to send us more data than it declared in it's content-length header".

from fastcgipp.

mfvargo avatar mfvargo commented on June 12, 2024

Ahhh. I see. Maybe I need to pass the content length in my nginx setup.

from fastcgipp.

mfvargo avatar mfvargo commented on June 12, 2024

That was it. I added CONTENT_TYPE and CONTENT_LENGTH to my fastcgi setup

  location /rtjambox {
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_param REQUEST_METHOD $request_method;
    fastcgi_param REQUEST_URI $uri;
    fastcgi_param QUERY_STRING $query_string;
    fastcgi_param CONTENT_TYPE    $content_type;
    fastcgi_param CONTENT_LENGTH  $content_length;
    fastcgi_pass unix:/tmp/rtjambox.sock;
  }

Thank you. for checking.

from fastcgipp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.