# SPDY patch not applying cleanly

**URL:** <https://www.ruby-forum.com/t/spdy-patch-not-applying-cleanly/227306>\
**Category:** NGINX\
**Created:** [March 11, 2013, 1:43am UTC](https://www.ruby-forum.com/t/spdy-patch-not-applying-cleanly/227306 "2013-03-11T01:43:14Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![SSAntS\_nio\_PSPSAlm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e47774/32.png) [@SSAntS\_nio\_PSPSAlm](https://www.ruby-forum.com/u/SSAntS_nio_PSPSAlm)\
**Post date:** [March 11, 2013, 1:43am UTC](https://www.ruby-forum.com/t/spdy-patch-not-applying-cleanly/227306/1 "2013-03-11T01:43:14Z")

</div>

Hello,

Apparently the SPDY patch doesn’t apply cleanly to 1.3.14. See the  
results below for the offending files.

I suppose that the patch should apply cleanly to the “dev” branch?

Thanks,  
— appa

|# HG changeset patch  
|# User Valentin B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
|# Date 1362681099 -14400  
|# Node ID b2981903b9bd996870a870b78a1409dbb9d4f528  
|# Parent 3dc1c0a21acbd7c0ed843c25f3cabb1879ae3480  
|Respect the new behavior of TCP\_DEFER\_ACCEPT.  
|  
|In Linux 2.6.32, TCP\_DEFER\_ACCEPT was changed to accept connections  
|after the deferring period is finished without any data available.  
|(Reading from the socket returns EAGAIN in this case.)  
|  
|Since in nginx TCP\_DEFER\_ACCEPT is set to “post\_accept\_timeout”, we  
|do not need to wait longer if deferred accept returns with no data.  
|  
|diff -r 3dc1c0a21acb -r b2981903b9bd src/http/ngx\_http\_request.c  
|— a/src/http/ngx\_http\_request.c Thu Mar 07 22:31:30 2013 +0400

| +++ b/src/http/ngx\_http\_request.c Thu Mar 07 22:31:39 2013 +0400 |
| --- |
| Patching file src/http/ngx\_http\_request.c using Plan A… |
| Hunk #1 FAILED at 416. |
| Hunk #2 succeeded at 540 (offset -77 lines). |
| 1 out of 2 hunks FAILED – saving rejects to file |
| src/http/ngx\_http\_request.c.rej |

* * *

|# HG changeset patch  
|# User Valentin B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
|# Date 1362681142 -14400  
|# Node ID 4fddad5dfe0a97bd6a48412fb4b1e8be0016f900  
|# Parent d0a841d5f19a2ef2d9e15c52ccfb76774413c59b  
|Refactored ngx\_http\_init\_request().  
|  
|Now it can be used as the request object factory with minimal impact on the  
|connection object. Therefore it was renamed to ngx\_http\_create\_request().  
|  
|diff -r d0a841d5f19a -r 4fddad5dfe0a src/http/ngx\_http\_request.c  
|— a/src/http/ngx\_http\_request.c Tue Oct 30 16:14:21 2012 +0400

| +++ b/src/http/ngx\_http\_request.c Thu Mar 07 22:32:22 2013 +0400 |
| --- |
| Patching file src/http/ngx\_http\_request.c using Plan A… |
| Hunk #1 FAILED at 11. |
| Hunk #2 FAILED at 466. |
| Hunk #3 FAILED at 483. |
| Hunk #4 succeeded at 392 (offset -101 lines). |
| Hunk #5 succeeded at 434 (offset -91 lines). |
| Hunk #6 FAILED at 540. |
| Hunk #7 succeeded at 492 (offset -90 lines). |
| Hunk #8 succeeded at 2612 (offset -99 lines). |
| Hunk #9 FAILED at 2759. |
| Hunk #10 FAILED at 3008. |
| 6 out of 10 hunks FAILED – saving rejects to file |
| src/http/ngx\_http\_request.c.rej |

* * *

|# HG changeset patch  
|# User Valentin B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
|# Date 1362683272 -14400  
|# Node ID 5d86db8e27827ad1f2ff4ebc560ecb95372e43e3  
|# Parent 69a3b3c0751ce2ed8c3eb2580c37027db7f2817e  
|Allow to reuse connections that wait their first request.  
|  
|This should improve behavior under deficiency of connections.  
|  
|diff -r 69a3b3c0751c -r 5d86db8e2782 src/http/ngx\_http\_request.c  
|— a/src/http/ngx\_http\_request.c Thu Mar 07 22:32:46 2013 +0400

| +++ b/src/http/ngx\_http\_request.c Thu Mar 07 23:07:52 2013 +0400 |
| --- |
| Patching file src/http/ngx\_http\_request.c using Plan A… |
| Hunk #1 succeeded at 353 (offset -1 lines). |
| Hunk #2 succeeded at 388 with fuzz 2 (offset 3 lines). |
| Hunk #3 FAILED at 439. |
| Hunk #4 FAILED at 473. |
| Hunk #5 succeeded at 538 (offset -80 lines). |
| Hunk #6 succeeded at 593 (offset -89 lines). |
| Hunk #7 FAILED at 728. |
| 3 out of 7 hunks FAILED – saving rejects to file |
| src/http/ngx\_http\_request.c.rej |

* * *

|diff -r c487eaf83bb7 -r 3e63aa2c08b7 src/http/modules/ngx\_http\_ssl\_module.c  
|— a/src/http/modules/ngx\_http\_ssl\_module.c Thu Mar 07 23:08:05 2013 +0400

| +++ b/src/http/modules/ngx\_http\_ssl\_module.c Sun Mar 10 21:23:04 2013 +0400 |
| --- |
| Patching file src/http/modules/ngx\_http\_ssl\_module.c using Plan A… |
| Hunk #1 FAILED at 275. |
| 1 out of 1 hunk FAILED – saving rejects to file |
| src/http/modules/ngx\_http\_ssl\_module.c.rej |

* * *

|diff -r c487eaf83bb7 -r 3e63aa2c08b7 src/http/ngx\_http\_request.c  
|— a/src/http/ngx\_http\_request.c Thu Mar 07 23:08:05 2013 +0400

| +++ b/src/http/ngx\_http\_request.c Sun Mar 10 21:23:04 2013 +0400 |
| --- |
| Patching file src/http/ngx\_http\_request.c using Plan A… |
| Hunk #1 FAILED at 11. |
| Hunk #2 succeeded at 30 (offset -1 lines). |
| Hunk #3 succeeded at 38 (offset -1 lines). |
| Hunk #4 succeeded at 51 (offset -1 lines). |
| Hunk #5 succeeded at 310 with fuzz 1 (offset -1 lines). |
| Hunk #6 FAILED at 487. |
| Hunk #7 FAILED at 726. |
| Hunk #8 succeeded at 1574 (offset -108 lines). |
| Hunk #9 succeeded at 1644 (offset -108 lines). |
| Hunk #10 succeeded at 1982 (offset -108 lines). |
| Hunk #11 succeeded at 2321 (offset -108 lines). |
| Hunk #12 succeeded at 2382 (offset -108 lines). |
| Hunk #13 succeeded at 2535 (offset -108 lines). |
| Hunk #14 succeeded at 3157 (offset -134 lines). |
| Hunk #15 succeeded at 3252 (offset -134 lines). |
| Hunk #16 succeeded at 3270 (offset -134 lines). |
| 3 out of 16 hunks FAILED – saving rejects to file |
| src/http/ngx\_http\_request.c.rej |

* * *

|diff -r c487eaf83bb7 -r 3e63aa2c08b7 src/http/ngx\_http\_request.h  
|— a/src/http/ngx\_http\_request.h Thu Mar 07 23:08:05 2013 +0400  
|+++ b/src/http/ngx\_http\_request.h Sun Mar 10 21:23:04 2013 +0400

---

<div class="post-metadata">

**Author:** ![SSAntS\_nio\_PSPSAlm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e47774/32.png) [@SSAntS\_nio\_PSPSAlm](https://www.ruby-forum.com/u/SSAntS_nio_PSPSAlm)\
**Post date:** [March 11, 2013, 1:59am UTC](https://www.ruby-forum.com/t/spdy-patch-not-applying-cleanly/227306/2 "2013-03-11T01:59:00Z")

</div>

On Monday 11 March 2013 04:42:36 Antnio P. P. Almeida wrote:

> Hello,
> 
> Apparently the SPDY patch doesn’t apply cleanly to 1.3.14. See the  
> results below for the offending files.  
> […]

You’re probably doing something wrong. I’ve just checked it myself:

% wget -q [http://nginx.org/download/nginx-1.3.14.tar.gz](http://nginx.org/download/nginx-1.3.14.tar.gz)  
% tar xzf nginx-1.3.14.tar.gz  
% cd nginx-1.3.14  
% wget -q [http://nginx.org/patches/spdy/patch.spdy.txt](http://nginx.org/patches/spdy/patch.spdy.txt)  
% patch -p1 \< patch.spdy.txt  
patching file src/http/ngx\_http\_request.c  
patching file src/http/ngx\_http\_request.c  
patching file src/http/ngx\_http\_request.c  
patching file src/core/ngx\_connection.c  
patching file src/core/ngx\_connection.h  
patching file src/http/ngx\_http\_request.c  
patching file src/http/ngx\_http\_upstream.c  
patching file src/http/ngx\_http\_request.c  
patching file src/http/ngx\_http\_request.h  
patching file src/http/modules/ngx\_http\_ssl\_module.c  
patching file src/http/modules/ngx\_http\_gzip\_filter\_module.c  
patching file src/http/ngx\_http\_request.c  
patching file src/core/ngx\_connection.c  
patching file src/event/ngx\_event.c  
patching file src/event/ngx\_event.h  
patching file src/http/modules/ngx\_http\_stub\_status\_module.c  
patching file auto/modules  
patching file auto/options  
patching file auto/sources  
patching file src/http/modules/ngx\_http\_ssl\_module.c  
patching file src/http/ngx\_http.c  
patching file src/http/ngx\_http.h  
patching file src/http/ngx\_http\_core\_module.c  
patching file src/http/ngx\_http\_core\_module.h  
patching file src/http/ngx\_http\_parse.c  
patching file src/http/ngx\_http\_request.c  
patching file src/http/ngx\_http\_request.h  
patching file src/http/ngx\_http\_request\_body.c  
patching file src/http/ngx\_http\_spdy.c  
patching file src/http/ngx\_http\_spdy.h  
patching file src/http/ngx\_http\_spdy\_filter\_module.c  
patching file src/http/ngx\_http\_spdy\_module.c  
patching file src/http/ngx\_http\_spdy\_module.h  
patching file src/http/ngx\_http\_upstream.c

No errors.

wbr, Valentin V. Bartenev

–

> **[nginx: donation](http://nginx.org/en/donation.html)**

---

<div class="post-metadata">

**Author:** ![SSAntS\_nio\_PSPSAlm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e47774/32.png) [@SSAntS\_nio\_PSPSAlm](https://www.ruby-forum.com/u/SSAntS_nio_PSPSAlm)\
**Post date:** [March 11, 2013, 2:19am UTC](https://www.ruby-forum.com/t/spdy-patch-not-applying-cleanly/227306/3 "2013-03-11T02:19:27Z")

</div>

On 11 Mar 2013 01h58 CET, [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> You’re probably doing something wrong. I’ve just checked it myself:

I just reproduced all your commands below with the same result. I.e.,  
no clean application, with rejection of some hunks ☹

— appa

---

<div class="post-metadata">

**Author:** ![SSAntS\_nio\_PSPSAlm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e47774/32.png) [@SSAntS\_nio\_PSPSAlm](https://www.ruby-forum.com/u/SSAntS_nio_PSPSAlm)\
**Post date:** [March 11, 2013, 8:32am UTC](https://www.ruby-forum.com/t/spdy-patch-not-applying-cleanly/227306/4 "2013-03-11T08:32:10Z")

</div>

On 3/11/13 5:18 AM, Antnio P. P. Almeida wrote:

> > % tar xzf nginx-1.3.14.tar.gz  
> > % cd nginx-1.3.14  
> > % wget -q [http://nginx.org/patches/spdy/patch.spdy.txt](http://nginx.org/patches/spdy/patch.spdy.txt)  
> > % patch -p1 \< patch.spdy.txt

Works just fine here.

–  
Maxim K.  
+7 (910) 4293178

> **[F5 NGINX: Built for cloud-native apps. Ready for AI traffic.](https://www.f5.com/products/nginx)**
>
> Deliver modern applications with NGINX. Explore high-performance load balancing, API gateways, and web server solutions trusted by top global enterprises.

---

<div class="post-metadata">

**Author:** ![SSAntS\_nio\_PSPSAlm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e47774/32.png) [@SSAntS\_nio\_PSPSAlm](https://www.ruby-forum.com/u/SSAntS_nio_PSPSAlm)\
**Post date:** [March 11, 2013, 11:27pm UTC](https://www.ruby-forum.com/t/spdy-patch-not-applying-cleanly/227306/5 "2013-03-11T23:27:27Z")

</div>

On 11 Mar 2013 03h17 CET, [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Please, verify the patch file:
> 
> % md5sum patch.spdy.txt  
> a5cb5cb3fc8a8e04efb62b2f8f48a5ac patch.spdy.txt
> 
> % shasum patch.spdy.txt  
> 1a9ffddffbde0812b67eaca91a22ff0aa17293cc patch.spdy.txt
> 
> Also, note that “patch --dry-run” (or “patch -C” in BSD world) does  
> not work with multiple patches in one file.

That was the issue. It works perfectly without the dry run.

Thanks,  
— appa

---

<div class="post-metadata">

**Author:** ![SSAntS\_nio\_PSPSAlm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e47774/32.png) [@SSAntS\_nio\_PSPSAlm](https://www.ruby-forum.com/u/SSAntS_nio_PSPSAlm)\
**Post date:** [March 11, 2013, 3:17am UTC](https://www.ruby-forum.com/t/spdy-patch-not-applying-cleanly/227306/6 "2013-03-11T03:17:53Z")

</div>

On Monday 11 March 2013 05:18:44 Antnio P. P. Almeida wrote:

> On 11 Mar 2013 01h58 CET, [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > You’re probably doing something wrong. I’ve just checked it myself:  
> > I just reproduced all your commands below with the same result. I.e.,  
> > no clean application, with rejection of some hunks ☹

Please, verify the patch file:

% md5sum patch.spdy.txt  
a5cb5cb3fc8a8e04efb62b2f8f48a5ac patch.spdy.txt

% shasum patch.spdy.txt  
1a9ffddffbde0812b67eaca91a22ff0aa17293cc patch.spdy.txt

Also, note that “patch --dry-run” (or “patch -C” in BSD world) does  
not work with multiple patches in one file.

wbr, Valentin V. Bartenev

–

> **[nginx: donation](http://nginx.org/en/donation.html)**
