static void openNextStream(FormStreamFields* form) { // Skip over any streams we can't open. // For some purposes we might want to return an error, but the current CFURLConnection // can't really do anything useful with an error at this point, so this is better. advanceCurrentStream(form); while (form->currentStream && !CFReadStreamOpen(form->currentStream)) advanceCurrentStream(form); }
static bool openNextStream(FormStreamFields* form) { // Skip over any streams we can't open. if (!advanceCurrentStream(form)) return false; while (form->currentStream && !CFReadStreamOpen(form->currentStream)) { if (!advanceCurrentStream(form)) return false; } return true; }
static bool openNextStream(FormStreamFields* form) { // CFReadStreamOpen() can cause this function to be re-entered from another thread before it returns. // One example when this can occur is when the stream being opened has no data. See <rdar://problem/23550269>. LockHolder locker(form->streamIsBeingOpenedOrClosedLock); // Skip over any streams we can't open. if (!advanceCurrentStream(form)) return false; while (form->currentStream && !CFReadStreamOpen(form->currentStream)) { if (!advanceCurrentStream(form)) return false; } return true; }