php://stdin limits?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • David Bruno

    php://stdin limits?

    Hello,
    I've made a script that parses emails with attachments.
    I tested the code using input from a file and everything was parsed
    correctly.
    However when I used "php://stdin" and piped emails to the script,
    it seems to just quit half way thru. There are no errors....but also no
    output.
    Is there a size limit for emails being piped to a script? Even with an
    attachment
    of 3k, it doesn't work. Can it not handle multi part MIME emails?

    thanks,
    David


  • EDWARD CHARKOW

    #2
    Re: php://stdin limits?

    David,

    I have been working with these alot lately. I kept finding that I forgot to
    chmod the script I was sending it to correctly. Check your chmod.

    Near as I can tell there isn't a limit, I am sending about 500,000
    characters and stripping sections out, and posting to a database, and
    creating a new page........and sending a few dozen of these e-mails back to
    back with no problems.

    If you display your code I will try and come take a peek.

    Ed

    "David Bruno" <webmaster@lowe stdomains.info> wrote in message
    news:crs2pb$e2v $1@daisy.noc.uc la.edu...[color=blue]
    > Hello,
    > I've made a script that parses emails with attachments.
    > I tested the code using input from a file and everything was parsed
    > correctly.
    > However when I used "php://stdin" and piped emails to the script,
    > it seems to just quit half way thru. There are no errors....but also no
    > output.
    > Is there a size limit for emails being piped to a script? Even with an
    > attachment
    > of 3k, it doesn't work. Can it not handle multi part MIME emails?
    >
    > thanks,
    > David
    >
    >[/color]


    Comment

    • Chung Leong

      #3
      Re: php://stdin limits?

      "David Bruno" <webmaster@lowe stdomains.info> wrote in message
      news:crs2pb$e2v $1@daisy.noc.uc la.edu...[color=blue]
      > Hello,
      > I've made a script that parses emails with attachments.
      > I tested the code using input from a file and everything was parsed
      > correctly.
      > However when I used "php://stdin" and piped emails to the script,
      > it seems to just quit half way thru. There are no errors....but also no
      > output.
      > Is there a size limit for emails being piped to a script? Even with an
      > attachment
      > of 3k, it doesn't work. Can it not handle multi part MIME emails?
      >
      > thanks,
      > David
      >[/color]

      Sounds like a pipe deadlock to me. That happens when a child process has
      filled up the output buffer and starts to wait for the parent process to
      move some data off the buffer. But the parent process is waiting for the
      child process to clear up some space in the input buffer so it can push in
      more data. So the whole thing stalls.

      Two way pipes are tricky to implement. I don't think PHP gives you the
      necessary means to do it.


      Comment

      Working...