小编use*_*414的帖子

当MySQL处于"发送数据"状态时,它意味着什么?

如果Mysql查询是什么意思:

SHOW PROCESSLIST;
Run Code Online (Sandbox Code Playgroud)

在State列中返回"发送数据"?

我想这意味着查询已经执行,MySQL正在向客户端发送"结果"数据,但我想知道为什么它花了这么多时间(长达一个小时).

谢谢.

mysql

148
推荐指数
2
解决办法
9万
查看次数

发现自动错误'./ltmain.sh'

我已经安装了mingw和msys mingw-get-setup.exe.我还安装了Autotools(autoconf,automake,m4,libtool)C:\/opt/autotools.

当我运行automake时,总会发生以下错误:

configure.ac:11: error: required file './ltmain.sh' not found
Run Code Online (Sandbox Code Playgroud)

如果我ltmain.sh从libtool的已安装树中复制,执行将正常完成.

如何在ltmain.sh不复制的情况下将automake配置为查找?

c automake autotools libtool mingw32

22
推荐指数
1
解决办法
2万
查看次数

套接字编程权限被拒绝

以下代码是TCP服务器程序只是发回"HELLO !!"给客户端.

当我使用端口80运行服务器时,返回bind()Permission denied.

端口12345没问题.

如何在此服务器程序中使用端口80?

#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>

int
main(){
    int sock0;
    struct sockaddr_in addr;
    struct sockaddr_in client;
    int len;
    int sock;
    char *message;
    message = "HELLO !!";
    sock0 = socket(AF_INET,SOCK_STREAM,0);
    addr.sin_family = AF_INET;
    addr.sin_port = htons(80);
    inet_pton(AF_INET,"127.0.0.1",&addr,sizeof(addr));
    bind(sock0,(struct sockaddr *)&addr,sizeof(addr));
    perror("bind");
    len = sizeof(client);
    sock = accept(sock0,(struct sockaddr *)&client,&len);
    perror("accept");
    write(sock,message,sizeof(message));
    perror("write");
    close(sock);
    return 0;
}
Run Code Online (Sandbox Code Playgroud)

c sockets

12
推荐指数
3
解决办法
3万
查看次数

协议不支持的地址族

以下代码是TCP客户端的套接字编程示例.

但是当我运行它时,connect()作为协议不支持的地址族返回.

我听说,如果平台不支持ipv6,就会发生这个问题.

但我写的AF_INET是ipv4.

我的服务器,即CentOS6.4,也是在inet6 addr中配置的.

有谁知道为什么?

#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>

int
main(){
    struct sockaddr_in server;
    int sock;
    char buf[32];
    int n;
    sock = socket(AF_INET,SOCK_STREAM,0);
    perror("socket");
    server.sin_family = AF_INET;
    server.sin_port = htons(12345);
    inet_pton(AF_INET,"127.0.0.1",&server,sizeof(server));
    connect(sock,(struct sockaddr *)&server,sizeof(server));
    perror("connect");
    memset(buf,0,sizeof(buf));
    n = read(sock,buf,sizeof(buf));
    perror("read");
    printf("%d,%s\n",n,buf);
    close(sock);
    return 0;
}
Run Code Online (Sandbox Code Playgroud)

c sockets centos ipv6

10
推荐指数
1
解决办法
6万
查看次数

我什么时候需要在OpenSSL中使用zlib?

有些网站用zlib描述了OpenSSL的配置和制作,而我可以在没有zlib的情况下完成.

这意味着在某些情况下,openSSL不需要zlib.

有谁告诉我OpenSSL在压缩或解压缩的情况下是什么情况?

@JakeGould的答案很有用.我想知道如何使用-z或不使用-z?

configuration openssl compilation zlib

10
推荐指数
2
解决办法
1万
查看次数

automake出错

我正在尝试为hello world示例C程序创建安装包.

我已经完成了以下工作.

自动扫描

mv configure.scan configure.ac编辑configure.ac以添加一些宏.

aclocal会

在其中创建Makefile.am

bin_PROGRAMS = hello
hello_SOURCES = hello.c
Run Code Online (Sandbox Code Playgroud)

最后我做了automake.

然后我收到了消息..

configure.ac:12: error: required file './compile' not found
configure.ac:12:   'automake --add-missing' can install 'compile'
configure.ac:6: error: required file './missing' not found
configure.ac:6:   'automake --add-missing' can install 'missing'
Makefile.am: error: required file './INSTALL' not found
Makefile.am:   'automake --add-missing' can install 'INSTALL'
Makefile.am: error: required file './NEWS' not found
Makefile.am: error: required file './README' not found
Makefile.am: error: required file './AUTHORS' not found
Makefile.am: error: required …
Run Code Online (Sandbox Code Playgroud)

automake autoconf autotools configure

9
推荐指数
2
解决办法
3万
查看次数

VPN 隧道中没有 SYN+ACK 响应

有两台Windows10 PC。

两台 PC 都连接 VPN,甚至连接到物理 LAN。

随着 VPN 连接的建立,我正在尝试在 PC-A 和 PC-B 之间为每个方向建立 RDP 连接。

但是,RDP 只允许一个方向。

PC-A >>> PC-B 正常

PC-A <<< PC-B 不行

我为 VPN 接口捕获了每台 PC 和每个方向的数据包。

成功案例中 PC-B 上的数据包显示client Hello在 TCPSYN和 之后SYN+ACK

但是,失败情况下PC-A 的数据包不显示client Hello,甚至不响应SYN+ACK

所以TCP Retransmission从 PC-B 发送了 3 次。

有谁知道为什么 PC-A 没有响应SYN+ACK

PC-A 可以响应 SYN+ACK 当它们与 VPN 断开连接时,物理 LAN 交替工作。

它似乎不是由VPN本身使用的。即使建立了VPN,我也可以拥有一个RDP方向。

vpn rdp tcp windows-10

7
推荐指数
1
解决办法
284
查看次数

如何从getaddrinfo()打印IP地址

我正在尝试在CentOS 6.4上使用C语言中的socket.

以下LIST1是我的代码.

我的代码从命令行获取主机名,并成功将数据报发送到服务器.

我想知道的是如何打印getaddrinfo()解析192.168.10.1格式的IP地址.

当我尝试打印IP地址时出现分段错误.

有谁知道如何修复此代码?

#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include <errno.h>

int
main(int argc,char *argv[]){
    int sock;
    struct addrinfo hints,*res;
    int n;
    int err;
    if(argc != 2){
        fprintf(stderr,"Usage : %s dst \n",argv[0]);
        return 1;
    } 
    memset(&hints,0,sizeof(hints));
    hints.ai_family = AF_UNSPEC; 
    hints.ai_socktype = SOCK_DGRAM;
    err = getaddrinfo(argv[1],"12345",&hints,&res);
    if(err != 0){
        perror("getaddrinfo");
        printf("getaddrinfo %s\n",strerror(errno));
        printf("getaddrinfo : %s \n",gai_strerror(err));
        return 1;
    }

    sock = socket(res->ai_family,res->ai_socktype,0);
    if(sock < 0){ …
Run Code Online (Sandbox Code Playgroud)

c sockets

5
推荐指数
1
解决办法
3万
查看次数

aclocal的搜索路径在哪里

当我运行automake --foreign --add-missing我的 C 程序编译时,我收到以下消息 。

mylib/Makefile.am:1: error: Libtool library used but 'LIBTOOL' is undefined
mylib/Makefile.am:1:   The usual way to define 'LIBTOOL' is to add 'LT_INIT'
mylib/Makefile.am:1:   to 'configure.ac' and run 'aclocal' and 'autoconf' again.
mylib/Makefile.am:1:   If 'LT_INIT' is in 'configure.ac', make sure
mylib/Makefile.am:1:   its definition is in aclocal's search path.
Run Code Online (Sandbox Code Playgroud)

这是我的configure.acwhitch 包括 LT_INIT。

AC_PREREQ([2.69])
AC_INIT([drive], [1], [admin@local])
AM_INIT_AUTOMAKE
AC_CONFIG_SRCDIR([src/drive.c])
AC_CONFIG_HEADERS([config.h])
# Checks for programs.
AC_PROG_CC
LT_INIT
AC_CONFIG_FILES([Makefile
                src/Makefile
                mylib/Makefile])
AC_OUTPUT
Run Code Online (Sandbox Code Playgroud)

mylib/Makefile.am 也在这里

lib_LTLIBRARIES = libmylib.la …
Run Code Online (Sandbox Code Playgroud)

c automake autoconf autotools

5
推荐指数
1
解决办法
4872
查看次数

使用.htaccess控制CakePHP的重定向

我在Windows7 + Apache2.2上安装了cakePHP,并尝试了博客教程.

现在我一直在混淆重定向控制与.htaccess.

我已经按照教程的说明设置了.htaccess.

htdocs
  .htaccess
  app
    .htaccess
     webroot
        .htaccess
Run Code Online (Sandbox Code Playgroud)

Eache .htaccess文件如下.

[在htdocs下]

<IfModule mod_rewrite.c>
   RewriteEngine On
   RewriteRule    ^$ app/webroot/    [L]
   RewriteRule    (.*) app/webroot/$1 [L]
</IfModule>
Run Code Online (Sandbox Code Playgroud)

[在应用程序下]

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteRule    ^$    webroot/    [L]
    RewriteRule    (.*) webroot/$1    [L]
</IfModule>
Run Code Online (Sandbox Code Playgroud)

[根据wabroot]

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>
Run Code Online (Sandbox Code Playgroud)

但是错误发生了,这里是error.log中的消息

client denied by server configuration: :/Apache2.2/htdocs/app/webroot/.htaccess
Run Code Online (Sandbox Code Playgroud)

怎么了 ?

本教程应用程序使用以下URL.

http://mydomain/posts/index   // show index page
http://mydomain/posts/view/3  //show an article selected from index(3 means …
Run Code Online (Sandbox Code Playgroud)

apache .htaccess mod-rewrite post cakephp

5
推荐指数
1
解决办法
667
查看次数