summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaleb Keithley <kaleb@freedesktop.org>2003-11-26 22:49:12 +0000
committerKaleb Keithley <kaleb@freedesktop.org>2003-11-26 22:49:12 +0000
commit5c5a2f87ce95576e6daa6c45a81d77a85250203e (patch)
tree58edc60fbb69308bf987e935228d53c963a561dc
parented922633ad2625aaaa6c4a36a7a24f8b95634c8c (diff)
merge latest (4.3.99.16) from XFree86 (vendor) branchXEVIE-BASE
-rw-r--r--helper/GetUrl.c19
-rw-r--r--plugin/Main.c10
-rw-r--r--rx/XDpyName.c13
-rw-r--r--rx/XUrls.c26
-rw-r--r--xnest-plugin/XnestDis.c9
5 files changed, 52 insertions, 25 deletions
diff --git a/helper/GetUrl.c b/helper/GetUrl.c
index e0b9eb0..d116209 100644
--- a/helper/GetUrl.c
+++ b/helper/GetUrl.c
@@ -26,7 +26,7 @@ other dealings in this Software without prior written authorization from
The Open Group.
*/
-/* $XFree86: xc/programs/xrx/helper/GetUrl.c,v 1.4 2001/12/14 20:02:16 dawes Exp $ */
+/* $XFree86: xc/programs/xrx/helper/GetUrl.c,v 1.5 2003/07/20 16:12:20 tsi Exp $ */
/*
* This file is really split into two major parts where GetUrl is implemented
@@ -206,6 +206,7 @@ ParseHttpUrl(char *url, char **hostname_ret, int *port_ret, char **path_ret)
int port;
char *ptr, *bos;
int status = 0;
+ int bracketed = 0;
/* check if it's an http url */
if (strncmp(HTTP, url, sizeof(HTTP) - 1))
@@ -213,8 +214,17 @@ ParseHttpUrl(char *url, char **hostname_ret, int *port_ret, char **path_ret)
/* parse hostname */
bos = ptr = url + sizeof(HTTP) - 1;
- while (*ptr && *ptr != ':' && *ptr != '/')
- ptr++;
+ /* Check for RFC 2732 bracketed IPv6 numeric address */
+ if (*ptr == '[') {
+ bos++;
+ while (*ptr && (*ptr != ']')) {
+ ptr++;
+ }
+ bracketed = 1;
+ } else {
+ while (*ptr && *ptr != ':' && *ptr != '/')
+ ptr++;
+ }
if (bos == ptr)
return 1; /* doesn't have any hostname */
@@ -227,6 +237,9 @@ ParseHttpUrl(char *url, char **hostname_ret, int *port_ret, char **path_ret)
/* make sure path is initialized in case of error */
path = NULL;
+ if (bracketed)
+ ptr++;
+
/* parse port */
if (*ptr != ':' || ! ptr[1])
port = HTTP_DEFAULT_PORT;
diff --git a/plugin/Main.c b/plugin/Main.c
index 002c768..7aab439 100644
--- a/plugin/Main.c
+++ b/plugin/Main.c
@@ -26,7 +26,7 @@ other dealings in this Software without prior written authorization from
The Open Group.
*/
-/* $XFree86: xc/programs/xrx/plugin/Main.c,v 1.8 2001/12/14 20:02:17 dawes Exp $ */
+/* $XFree86: xc/programs/xrx/plugin/Main.c,v 1.9 2003/05/27 22:27:09 tsi Exp $ */
/*
* RX plug-in module based on the UnixTemplate file provided by Netcape.
@@ -281,10 +281,6 @@ int32 STREAMBUFSIZE = 0X0FFFFFFF; /* If we are reading from a file in NPAsFile
int32
NPP_WriteReady(NPP instance, NPStream *stream)
{
- PluginInstance* This;
- if (instance != NULL)
- This = (PluginInstance*) instance->pdata;
-
return STREAMBUFSIZE;
}
@@ -360,8 +356,6 @@ NPP_Write(NPP instance, NPStream *stream, int32 offset, int32 len, void *buf)
void
StartApplication(PluginInstance* This)
{
- NPError err;
-
#ifndef NO_STARTING_STATE
RxpSetStatusWidget(This, STARTING);
#else
@@ -371,7 +365,7 @@ StartApplication(PluginInstance* This)
/* perform GET request
* throwing away the response.
*/
- err = NPN_GetURL(This->instance, This->query, NULL);
+ (void) NPN_GetURL(This->instance, This->query, NULL);
This->parse_reply = 1; /* we want to print out the answer */
}
diff --git a/rx/XDpyName.c b/rx/XDpyName.c
index 0a5c006..106f2e3 100644
--- a/rx/XDpyName.c
+++ b/rx/XDpyName.c
@@ -26,6 +26,7 @@ other dealings in this Software without prior written authorization from
The Open Group.
*/
+/* $XFree86: xc/programs/xrx/rx/XDpyName.c,v 1.7 2003/10/24 20:38:22 tsi Exp $ */
#ifdef XP_UNIX
#include "RxPlugin.h" /* for PluginGlobal */
@@ -68,9 +69,7 @@ The Open Group.
* Compute the number of bytes for a STRING representation
*/
-#define STRING_BYTES(_str) (2 + (_str ? strlen (_str) : 0) + \
- PAD64 (2 + (_str ? strlen (_str) : 0)))
-
+#define STRING_BYTES(_str) (2 + strlen(_str) + PAD64(2 + strlen(_str)))
#define SKIP_STRING(_pBuf, _swap) \
@@ -94,7 +93,7 @@ The Open Group.
#define STORE_STRING(_pBuf, _string) \
{ \
- int _len = _string ? strlen (_string) : 0; \
+ int _len = strlen(_string); \
STORE_CARD16 (_pBuf, _len); \
if (_len) { \
memcpy (_pBuf, _string, _len); \
@@ -182,6 +181,8 @@ typedef struct {
char *error;
} GetProxyAddrReply;
+#if 0
+#else
static int findproxy (proxyname, manager, server, name)
char* proxyname;
char* manager;
@@ -292,7 +293,7 @@ static int findproxy (proxyname, manager, server, name)
}
return 1;
}
-
+#endif
static void
@@ -326,8 +327,10 @@ Bool *replyReadyRet;
GetProxyAddrReply *reply =
(GetProxyAddrReply *) (replyWait->reply);
+#if 0 /* No-op */
CHECK_AT_LEAST_SIZE (iceConn, PMOPCODE, opcode,
length, SIZEOF (pmGetProxyAddrReplyMsg), IceFatalToProtocol);
+#endif
IceReadCompleteMessage (iceConn, SIZEOF (pmGetProxyAddrReplyMsg),
pmGetProxyAddrReplyMsg, pMsg, pStart);
diff --git a/rx/XUrls.c b/rx/XUrls.c
index ec1f7c1..105a805 100644
--- a/rx/XUrls.c
+++ b/rx/XUrls.c
@@ -26,7 +26,7 @@ other dealings in this Software without prior written authorization from
The Open Group.
*/
-/* $XFree86: xc/programs/xrx/rx/XUrls.c,v 1.11 2001/12/14 20:02:19 dawes Exp $ */
+/* $XFree86: xc/programs/xrx/rx/XUrls.c,v 1.12 2003/07/20 16:12:20 tsi Exp $ */
#include "RxI.h"
#include "XUrls.h"
@@ -142,7 +142,7 @@ MyBestHostname (
} else { /* otherwise believe the display_name */
char *ptr;
- ptr = strchr(display_name, ':');
+ ptr = strrchr(display_name, ':');
if (ptr == NULL) {
/* if there's no ":0" in the name, just copy it */
strncpy(myname, display_name, myname_len);
@@ -343,13 +343,21 @@ ParseHostname(char *url, char *buf, int buflen)
while (*ptr && *ptr == '/')
ptr++;
begin = ptr;
- /* look for possible port specification */
- ptr = strchr(begin, ':');
- if (ptr == NULL) {
- /* look for possible path */
- ptr = strchr(begin, '/');
- if (ptr == NULL)
- ptr += strlen(begin);
+ /* Check for RFC 2732 bracketed IPv6 numeric address */
+ if (*ptr == '[') {
+ begin++;
+ while (*ptr && (*ptr != ']')) {
+ ptr++;
+ }
+ } else {
+ /* look for possible port specification */
+ ptr = strchr(begin, ':');
+ if (ptr == NULL) {
+ /* look for possible path */
+ ptr = strchr(begin, '/');
+ if (ptr == NULL)
+ ptr += strlen(begin);
+ }
}
if (ptr - begin < buflen) {
strncpy(buf, begin, ptr - begin);
diff --git a/xnest-plugin/XnestDis.c b/xnest-plugin/XnestDis.c
index 10dddf0..36266e4 100644
--- a/xnest-plugin/XnestDis.c
+++ b/xnest-plugin/XnestDis.c
@@ -26,6 +26,7 @@ other dealings in this Software without prior written authorization from
The Open Group.
*/
+/* $XFree86: xc/programs/xrx/xnest-plugin/XnestDis.c,v 1.3 2003/07/20 16:12:21 tsi Exp $ */
#include "RxPlugin.h"
@@ -86,6 +87,13 @@ RxpXnestDisplay(int display_number)
else
dpy_name = display_name;
+ /* Check for RFC 2732 bracketed IPv6 numeric address */
+ if (*dpy_name == '[') {
+ while (*dpy_name && (*dpy_name != ']')) {
+ dpy_name++;
+ }
+ }
+
/* display number is after next ":" character */
display_num = strchr(dpy_name, ':');
if (display_num == NULL) /* invalid display specification */
@@ -104,3 +112,4 @@ RxpXnestDisplay(int display_number)
return name;
}
+