View previous topic :: View next topic |
Author |
Message |
HonzaCZ
Joined: 31 Jan 2011 Posts: 3
|
Posted: Mon Jan 31, 2011 12:25 am Post subject: patch for MiniDLNA |
|
|
Hi,
Can anyone help me with making of patch for MiniDLNA to using MiniSSDPd?
I want to use MiniUPNPd and MiniDLNA simultaneously.
Thanks. |
|
Back to top |
|
|
miniupnp Site Admin
Joined: 14 Apr 2007 Posts: 1593
|
|
Back to top |
|
|
miniupnp Site Admin
Joined: 14 Apr 2007 Posts: 1593
|
|
Back to top |
|
|
HonzaCZ
Joined: 31 Jan 2011 Posts: 3
|
Posted: Thu Feb 03, 2011 11:28 pm Post subject: |
|
|
Thanks, after some magic applied I made it work under FreeBSD
I wanted to apply Samsung patch too, but I'm too lame... I can't fix this:
Code: | warning: cast from pointer to integer of different size |
Part of problematic code from patch:
Code: | +/* append data to buffer, if necessary get more memory and rebase current ptr */
+void
+add_to_buffer(char** buffer, int* length, char** ptr, const char* data, int datalen)
+{
+ if (*ptr - *buffer > *length) {
+ *ptr -= (int)*buffer;
+ adjust_buffer(buffer, length);
+ *ptr += (int)*buffer; /* rebase ptr */
+ }
+ memcpy(*ptr, data, datalen);
+ *ptr += datalen;
+}
|
|
|
Back to top |
|
|
miniupnp Site Admin
Joined: 14 Apr 2007 Posts: 1593
|
Posted: Fri Feb 04, 2011 9:26 am Post subject: |
|
|
HonzaCZ wrote: | Thanks, after some magic applied I made it work under FreeBSD
I wanted to apply Samsung patch too, but I'm too lame... I can't fix this:
Code: | warning: cast from pointer to integer of different size |
Part of problematic code from patch:
Code: | +/* append data to buffer, if necessary get more memory and rebase current ptr */
+void
+add_to_buffer(char** buffer, int* length, char** ptr, const char* data, int datalen)
+{
+ if (*ptr - *buffer > *length) {
+ *ptr -= (int)*buffer;
+ adjust_buffer(buffer, length);
+ *ptr += (int)*buffer; /* rebase ptr */
+ }
+ memcpy(*ptr, data, datalen);
+ *ptr += datalen;
+}
|
|
I guess you are compiling on a 64bit machine.
try to replace (int) by (int64_t).
Or maybe removing the cast is the solution. _________________ Main miniUPnP author.
https://miniupnp.tuxfamily.org/ |
|
Back to top |
|
|
HonzaCZ
Joined: 31 Jan 2011 Posts: 3
|
Posted: Fri Feb 04, 2011 10:36 am Post subject: |
|
|
miniupnp wrote: | I guess you are compiling on a 64bit machine.
try to replace (int) by (int64_t).
Or maybe removing the cast is the solution. | You are right! Solved! Thank you, so much
There are my patches for actual FreeBSD port version (copy to /usr/ports/net/minidlna/files/):
http://temp.solc.name/patch-ssdpd
http://temp.solc.name/patch-zsamsung |
|
Back to top |
|
|
miniupnp Site Admin
Joined: 14 Apr 2007 Posts: 1593
|
|
Back to top |
|
|
coatto87
Joined: 28 May 2011 Posts: 1
|
Posted: Sat May 28, 2011 10:20 am Post subject: |
|
|
miniupnp wrote: | updated Patch for the new version of miniDLNA (1.0.19) :
|
It doesn't work on the latest cvs of miniDLNA.
Code: |
Applying ./patches/050-minissdpd.patch using plaintext:
patching file codelength.h
patching file minidlna.c
Hunk #1 succeeded at 554 (offset 14 lines).
Hunk #2 succeeded at 943 (offset 15 lines).
patching file minissdp.c
Hunk #2 succeeded at 45 with fuzz 2 (offset 2 lines).
Hunk #3 succeeded at 74 (offset 2 lines).
Hunk #4 succeeded at 248 (offset 12 lines).
Hunk #5 FAILED at 343.
Hunk #6 succeeded at 381 with fuzz 2 (offset 18 lines).
Hunk #7 succeeded at 677 (offset 206 lines).
Hunk #8 succeeded at 741 (offset 206 lines).
1 out of 8 hunks FAILED -- saving rejects to file minissdp.c.rej
patching file minissdp.h
patching file options.c
patching file options.h
patching file upnpglobalvars.c
patching file upnpglobalvars.h
Hunk #1 succeeded at 205 (offset 15 lines).
Patch failed! Please fix ./patches/050-minissdpd.patch!
|
minissdp.c.rej
Code: |
--- minissdp.c 2011-03-15 03:50:13.000000000 +0100
+++ minissdp.c 2011-05-27 11:46:53.000000000 +0200
@@ -343,17 +350,12 @@
* process SSDP M-SEARCH requests and responds to them */
void
ProcessSSDPRequest(int s, unsigned short port)
-/*ProcessSSDPRequest(int s, struct lan_addr_s * lan_addr, int n_lan_addr,
- unsigned short port)*/
{
int n;
char bufr[1500];
socklen_t len_r;
struct sockaddr_in sendername;
- int i, l;
- int lan_addr_index = 0;
- char * st = NULL, * mx = NULL, * man = NULL, * mx_end = NULL;
- int st_len = 0, mx_len = 0, man_len = 0, mx_val = 0;
+
len_r = sizeof(struct sockaddr_in);
n = recvfrom(s, bufr, sizeof(bufr), 0,
|
|
|
Back to top |
|
|
miniupnp Site Admin
Joined: 14 Apr 2007 Posts: 1593
|
Posted: Sat May 28, 2011 2:01 pm Post subject: |
|
|
coatto87 wrote: | miniupnp wrote: | updated Patch for the new version of miniDLNA (1.0.19) :
|
It doesn't work on the latest cvs of miniDLNA.
|
The rejected part doesn't look important. I think it's going to work _________________ Main miniUPnP author.
https://miniupnp.tuxfamily.org/ |
|
Back to top |
|
|
miniupnp Site Admin
Joined: 14 Apr 2007 Posts: 1593
|
|
Back to top |
|
|
AzaToth
Joined: 31 May 2011 Posts: 3
|
Posted: Tue May 31, 2011 12:53 pm Post subject: |
|
|
Have applied the patch for my github repo in the minissdp branch
Before I merge it into main line I would require to know whom is the author though. |
|
Back to top |
|
|
AzaToth
Joined: 31 May 2011 Posts: 3
|
|
Back to top |
|
|
miniupnp Site Admin
Joined: 14 Apr 2007 Posts: 1593
|
Posted: Tue May 31, 2011 9:25 pm Post subject: |
|
|
AzaToth wrote: | Have applied the patch for my github repo in the minissdp branch
Before I merge it into main line I would require to know whom is the author though. |
The author of the patch is me, Thomas Bernard _________________ Main miniUPnP author.
https://miniupnp.tuxfamily.org/ |
|
Back to top |
|
|
AzaToth
Joined: 31 May 2011 Posts: 3
|
Posted: Tue May 31, 2011 10:17 pm Post subject: |
|
|
miniupnp wrote: | AzaToth wrote: | Have applied the patch for my github repo in the minissdp branch
Before I merge it into main line I would require to know whom is the author though. |
The author of the patch is me, Thomas Bernard |
Ok, merged: https://github.com/azatoth/minidlna |
|
Back to top |
|
|
miniupnp Site Admin
Joined: 14 Apr 2007 Posts: 1593
|
|
Back to top |
|
|
|