apply shaofeng's patch for server